I am making a GET from C#.
var result = webClient.DownloadString(
Microsoft.JScript.GlobalObject.encodeURI(
"http://www.example.com?value=contacts[contact][0][name]=test man"
);
This results in the recieving PHP site:
“value=contacts%5Bcontact%5D%5B0%5D%5Bname%5D=test%20man”
After decoding in PHP
urldecode($value)
“value=contacts%5Bcontact%5D%5B0%5D%5Bname%5D=test man”
So error on the [
But when i paste the url in a browser (IE8 or Chrome) i get this results in the recieving PHP site:
“value=contacts[contact][0][name]=test%20man”
IE. The browser sends the request (url) in a workable encoding, my code does not.
How do I use the GET with the correct encoding, as the browsers do?
It was a lot of chars that had higher Code Points, that needs a %25 infront to parse right in PHP.
Ex. å = %C3%E5 in encoding .NET
but shold be:
%25C3%25E5
So I made a function for correcting this, it is not complete for reuse, but will be if all other codes are added.