HttpWebRequest POST no longer working to Canada Post website

L

leeedw

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_response-e.asp"

' Create the web request.
objWebRequest =
CType(System.Net.WebRequest.Create(CANADA_POST_URL),
System.Net.HttpWebRequest)
objWebRequest.Method = "POST"
objWebRequest.ContentType =
"application/x-www-form-urlencoded"
objWebRequest.ContentLength = aPostData.Length

' Write the post data.
objStream = objWebRequest.GetRequestStream()
objStream.Write(aPostData, 0, aPostData.Length)
objStream.Close()

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top