Last post Mar 23, 2015 08:11 PM by JohnBert
Mar 03, 2015 04:47 AM|MesutTalebi|LINK
I have a Url that is already url encoded and a hash is generated for the encoded part. I need to get the response of this url in server side, but the problem is webrequest changes to Upper case the encoded part of the url so in the other side when api tries
to rehash and check the request it fails.
the original url string is:
and after initialize using webrequest.create function it turned to:
the change in hex parts of url (for example: Deneme%20Alt%20%c4%b0%c3%a7erik
!= Deneme%20Alt%20%C4%B0%C3%A7erik | or => logoutURL=http%3a%2f%2fidollive.idolyazilim.net
!= logoutURL=http:%2f%2fidollive.idolyazilim.net) prevent the verification phase of the app in the other api site. (please pay attention to change in http%3a changed to http: )
so simply I want to force WebRequest to not change casing of my url or is there another library to sent http request and get response?
Note: this behavior is only in .net 4.5 and in .net 4.0 I didn't have this problem.
Mar 04, 2015 03:39 AM|May-song|LINK
Have a look at the link
Hope this could help you.
Mar 04, 2015 05:34 AM|MesutTalebi|LINK
Dear May-song Thank you for your reply, but are you understand my question? I already can send request and get response, but the problem is webrequest or maybe Uri used in it changes my Url casting and also some characters that this ıssue problems with encrypting
system in the other site.
Mar 04, 2015 05:27 PM|Paul Linton|LINK
Can you show your code - both sending and receiving side.
Please don't post your entire application. Create a small project which exhibits the problem then post the essential pieces of code such that anyone can reproduce your problem.
Mar 23, 2015 08:11 PM|JohnBert|LINK
Doing this requires understanding how HTTP redirects work. When you use
Response.Redirect(), you send a response (to the browser that made the request) with
HTTP Status Code 302, which tells the browser where to go next. By definition, the browser will make that via a
GET request, even if the original request was a POST.
Another option is to use
HTTP Status Code 307, which specifies that the browser should make the redirect request in the same way as the original request, but to prompt the user with a security warning. To do that, you would write something like this:
public void PageLoad(object sender, EventArgs e)
// Process the post on your side
Response.Status = "307 Temporary Redirect";