How to set character set using XMLHttp object for POST in classic ASP?

I need to use the XMLHttp object in classic ASP to send some data to another server via HTTP from server to server:

sURL = SOME_URL

Set oXHttp = Server.CreateObject("Msxml2.XMLHTTP")

oXHttp.open "POST", sURL, false 
oXHttp.setRequestHeader "Content-Type", "application/x-www-form-urlencoded;charset:ISO-8859-1;"

sPost = SOME_FORM_DATA

oXHttp.send(sPost)

I was told (by supporting a consumer server) that depending on whether I use this code from Windows Server 2000 (IIS 5) or Windows Server 2003 (IIS 6), it gets 1 (Windows 2000 Server) or UTF-8 ( Windows Server 2003).

I did not find any property or method for setting the character set that I should send. Does this depend on some Windows configuration settings or scripts (asp)?

+3
source
2

, "SXH_OPTION_URL_CODEPAGE"

http://msdn.microsoft.com/en-us/library/ms763811(VS.85).aspx

"MSXML2.ServerXMLHTTP", "MSXML2.XMLHttp", .

+6

, SXH_OPTION_URL_CODEPAGE, . , , .

":" "=" . :

oXHttp.setRequestHeader "Content-Type", "application/x-www-form-urlencoded; charset = ISO-8859-1"

+4
source

Source: https://habr.com/ru/post/1698141/


All Articles