-2

Any C# solutions i tried failed on this url - http://www.streetmap.co.uk/newmap.srf?x=529725&y=182411&z=0&sv=WC1H%2B0BX&st=2&pc=WC1H%2B0BX&mapp=newmap.srf&searchp=newsearch.srf.

Because of '&' character. Is there any C# code that handles such urls in correct way?

UPD. Here is the solution

clumpter
  • 1,898
  • 6
  • 27
  • 38

2 Answers2

3

You need to encode the url using:

var safeUrl = HttpServerUtility.UrlEncode("http://google.com?q=hello&x=123");
ilivewithian
  • 19,476
  • 19
  • 103
  • 165
0

HTTP status code 403 stands for "Forbidden". You should verify your checksum;

The trick to request the Google PageRank is to calculate the proper checksum of the given URL. Without the "google checksum" of the URL, you'll get a 403 Forbidden error. Source

Stefan
  • 5,644
  • 4
  • 24
  • 31
  • Well, as you might see that's what my question is all about. Checksum is incorrect because of '&' in url. Do you know how to calculate it right? – clumpter Jan 31 '12 at 19:18
  • Where did you download the lib. you´re using and does it contain any API documentation? You should most likely calculate the checksum using the raw URL, that´s before it´s encoded. – Stefan Feb 01 '12 at 05:57
  • No libs or dlls. There are several code samples in the Internet. – clumpter Feb 01 '12 at 12:57