Page 1 of 1

XHR -Anfrage an PHP

Posted: 18 Apr 2025, 00:59
by Anonymous
Ich habe Probleme mit einer XHR -Postanforderung.

Code: Select all

self.xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
self.xhr.setRequestHeader("Method", "POST " + url + " HTTP/1.1");
< /code>
In Firebug: < /p>
Parametersapplication/x-www-form-urlencoded
{"u":"andrepadez","m":"\n...
JSON
m
"sfdsfsdfdsfdsf"
u
"andrepadez"
Source
{"u":"andrepadez","m":"\nsfdsfsdfdsfdsf"}
< /code>
In .NET, ich poste dies auf ein .ashx, und im prozessualen Zeitpunkt tue ich: < /p>
StreamReader sr = new StreamReader(context.Request.InputStream, context.Request.ContentEncoding);
javaScriptSerializer.Deserialize(message);
Und ich habe keine Probleme.>