Http & unicode: Sending strings
Posted: Thu May 25, 2006 5:56 am
Currently, in order to get a server to recognise a POSTed string (set up via HttpSendRequest) I am doing this:
However info sent via HttpAddRequestHeaders, like this:
works as is.
On retrieving data received from the server into a buffer I use
These klurges appear to be working, however I would like to feel secure that this is ok in all circumstances (with strings) and not a fluke.
Also is there some rule here with strings and HTTP, as to when servers need ASCII and when the unicode string is ok? Does this differ server to server (eg, Apache -v- IIS)
Thanks!
Code: Select all
PokeS(dta,PeekS(dta,dLen),dLen,#PB_Ascii)
r = HttpSendRequest_(hOpen,0,0,dta,dLen)
Code: Select all
wrk = "Content-Type: application/x-www-form-urlencoded"+Chr(13)+Chr(10)
r = HttpAddRequestHeaders_(hOpen, @wrk,Len(wrk), #HTTP_ADDREQ_FLAG_ADD|#HTTP_ADDREQ_FLAG_REPLACE)
On retrieving data received from the server into a buffer I use
Code: Select all
PeekS(buffer,finalTotalCharsAsReportedByOS,#PB_Ascii)
Also is there some rule here with strings and HTTP, as to when servers need ASCII and when the unicode string is ok? Does this differ server to server (eg, Apache -v- IIS)
Thanks!