Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem with WinHttp.WinHttpRequest
Message
From
24/07/2007 00:57:38
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Internet applications
Title:
Problem with WinHttp.WinHttpRequest
Miscellaneous
Thread ID:
01243080
Message ID:
01243080
Views:
100
With next code I want to send bynary data to php script:

lcData = filetostr("MyFile.dat")
loHTTP = CREATEOBJECT('WinHttp.WinHttpRequest.5.1')
loHTTP.Open("POST", "http://www.MySite.com/MyScript.php", .f.)
loHttp.setrequestheader("content-type","application/x-www-form-urlencoded")

IF NOT loHTTP.Send( lcData )
MESSAGEBOX( loHTTP.ErrorCode+loHTTP.ErrorMsg)
ENDIF


In this script $HTTP_RAW_POST_DATA gets only first 5 symbols
Maybe problem is connected with next info
from loHTTP.GetAllResponseHeaders() :
----------------------------
Date: Mon, 23 Jul 2007 09:24:58 GMT
Server: Apache/1.3.37 (Unix) mod_auth_passthrough/1.8 mod_log_bytes/1.2
mod_bwlimited/1.4 PHP/4.4.4 FrontPage/5.0.2.2635.SR1.2 mod_ssl/2.8.28
OpenSSL/0.9.7e-p1
X-Powered-By: PHP/4.4.4
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: text/html; charset=cp1251
------------------------------

Why "Content-Type" is text/html ?

Thanks in advance for any help
Next
Reply
Map
View

Click here to load this message in the networking platform