473,789 Members | 2,785 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

HttpWebRequest POST no longer working to Canada Post website

Hi there,

We have an application that posts data to the canadapost.ca website to
retrieve postal codes. This was working for quite some time until this
week when Canada Post changed their website. Now it no longer works.
Here is the code snippet:

Const CANADA_POST_URL As String =
"http://www.canadapost. ca/tools/pcl/bin/cp_search_respo nse-e.asp"

' Create the web request.
objWebRequest =
CType(System.Ne t.WebRequest.Cr eate(CANADA_POS T_URL),
System.Net.Http WebRequest)
objWebRequest.M ethod = "POST"
objWebRequest.C ontentType =
"applicatio n/x-www-form-urlencoded"
objWebRequest.C ontentLength = aPostData.Lengt h

' Write the post data.
objStream = objWebRequest.G etRequestStream ()
objStream.Write (aPostData, 0, aPostData.Lengt h)
objStream.Close ()

Anyone know how I can post to their website now?
Thanks!

Nov 24 '06 #1
1 1832
Anyone?

le****@hotmail. com wrote:
Hi there,

We have an application that posts data to the canadapost.ca website to
retrieve postal codes. This was working for quite some time until this
week when Canada Post changed their website. Now it no longer works.
Here is the code snippet:

Const CANADA_POST_URL As String =
"http://www.canadapost. ca/tools/pcl/bin/cp_search_respo nse-e.asp"

' Create the web request.
objWebRequest =
CType(System.Ne t.WebRequest.Cr eate(CANADA_POS T_URL),
System.Net.Http WebRequest)
objWebRequest.M ethod = "POST"
objWebRequest.C ontentType =
"applicatio n/x-www-form-urlencoded"
objWebRequest.C ontentLength = aPostData.Lengt h

' Write the post data.
objStream = objWebRequest.G etRequestStream ()
objStream.Write (aPostData, 0, aPostData.Lengt h)
objStream.Close ()

Anyone know how I can post to their website now?
Thanks!
Nov 28 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
8193
by: Mike Cronin via DotNetMonster.com | last post by:
Hi there, Can anyone tell me what level of encryption is used when making an HTTPS POST request through an instance of the System.Net.HttpWebRequest object? Thanks much in advance! Mike Cronin Data On Call - Programmer
6
3094
by: omyek | last post by:
I'm trying to mimic the browsing of a webpage using an HttpWebRequest. I've had a lot of luck with it so far, including logging into pages, posting form data, and even collecting and using cookies. However, I ran into a scenario that I'm baffled by. I have a website which requires a user to login. This is nothing new and I was able to successfully log in. For our case, let's say the URL to the login page is http://login.html
1
2611
by: sfoxover | last post by:
Hi, Could someone please give me some suggestions on how to make this class robust. I need to be able to handle around 20 similtanious requests to this class which causes a web browser to display a waiting message while it requests XML data from a third party server. Some requests can take around 30 seconds. Usually the first time I do the request it always works. If I try again without closing the web browser it will fail sometimes....
3
4931
by: JansenH | last post by:
We have implemented a 'HTTP Post' client in C# that posts Xml documents to a webserver. This is working fine if the post rate is one post for every 20 seconds. But if the post rate is increased to one post for every 10 seconds the client start getting error 403 'forbidden' from the webserver after a short period of time. The webserver is IIS. The choking of the client/server communication when doing high frequency posting is due to that we...
2
9697
by: GHS | last post by:
I have some code to connect to a website and pull some content out of the HTML. I've verified that the 2 URLs I'm using are perfectly fine in Internet Explorer and both of them return results "pretty quickly". The first URL I try takes a while but eventually comes back with the correct results. It took *much longer* than in Internet Explorer. The second URL times out even if I increase the timeout value significantly. Internet explorer...
2
1892
by: ReGex | last post by:
I have been working on a little project in C# to log into a website (using code inspired/riipped from http://www.codeproject.com/cs/internet/bloglivejournal.asp) but when I request the response, the packet that is sent out is an HTTP GET (I'm watching the outgoing packet via Ethereal). The code I'm using is identical to that above, only configured for the site I'm trying to communicate with. Are there any ideas out there for why a...
0
925
by: leeedw | last post by:
Hi there, I have an application that posts data to the canadapost.ca website to retrieve postal codes. This was working for quite some time until this week when Canada Post changed their website. Now it no longer works. Here is the code snippet: Const CANADA_POST_URL As String = "http://www.canadapost.ca/tools/pcl/bin/cp_search_response-e.asp"
4
12712
by: Natalia | last post by:
Hello, I need to provide the ability to post file and some form elements via our website (asp.net) to the third party website (asp page). On http://aspalliance.com/236#Page4 - I found great advices but still having troubles... it might some obvious error that I am making but I just dont see it. ==================FIRST - Webclient=================================
0
12798
by: barrybevel | last post by:
Hi, I'm trying to login to the www.vodafone.ie website using HttpWebRequest. It works fine with IE/Firefox and the .NET Web Control too, just not with my code. I think it's a redirect 302 problem. I'm using this code in a ASP.NET 2.0 application just in case that matters, maybe someone knows a better way to do this?
0
9511
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10408
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10139
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9983
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9020
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7529
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5417
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4092
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2909
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.