PC SOFT

PROFESSIONAL NEWSGROUPS
WINDEVWEBDEV and WINDEV Mobile

Home → WINDEV Mobile 2024 → HTTPRequest Post data truncated
HTTPRequest Post data truncated
Started by Debzidoodle, Jun., 27 2014 4:54 AM - 3 replies
Posted on June, 27 2014 - 4:54 AM
Hi All,

I am doing a HTTPRequest and my post data is only sending the first character. I can switch this to be a GET and it works fine, so whats wrong with my post? Below are the results I get, and you can see only the L of Login is being sent... any ideas?
I am using WDM 18


HTTPRequest("http://10.211.55.4:88/GetDriverAuthCode", "","", "Login=MyUserName&Password=MyPassword")



This is what is sent:


POST /GetDriverAuthCode HTTP/1.1
Content-Length: 68
Content-Type: application/x-www-form-urlencoded
Accept: */*
Host: 10.211.55.4:88
User-Agent:
Connection: close

L
Posted on June, 27 2014 - 12:48 PM
Hi Debra

I'm not sure at all, but I suspect the following:
- in wd 18, by default, strings are unicode... ie for any 'normal' ascii
character, they contain 0s each two bytes...
- 0 is the end of string character
- ergo you send only thefirst character of your string

to verify this, you can try:
- using specifically an ansi string
- of, much better, prepare your parameter with URLencode (after all, it
is made expressly for that purpose)

Best regards

--
Fabrice Harari
International WinDev, WebDev and WinDev mobile Consulting

NEW: WXShowroom.com is available: Show your projects!
More information on http://www.fabriceharari.com



On 6/26/2014 8:54 PM, Debzidoodle wrote:
Hi All,

I am doing a HTTPRequest and my post data is only sending the first
character. I can switch this to be a GET and it works fine, so whats
wrong with my post? Below are the results I get, and you can see only
the L of Login is being sent... any ideas?
I am using WDM 18


HTTPRequest("http://10.211.55.4:88/GetDriverAuthCode", "","",
"Login=MyUserName&Password=MyPassword")



This is what is sent:


POST /GetDriverAuthCode HTTP/1.1
Content-Length: 68
Content-Type: application/x-www-form-urlencoded
Accept: */*
Host: 10.211.55.4:88
User-Agent: Connection: close

L
Posted on June, 27 2014 - 2:38 PM
Thank you! Using an ansi string did the trick!
Posted on June, 27 2014 - 3:21 PM
be careful that it maybe enough for this case, but the user of URLencode
is ALWAYS a good idea, as, depending on the CONTENT of your string, it
may or MAY NOT work if you don't use it

Best regards


--
Fabrice Harari
International WinDev, WebDev and WinDev mobile Consulting

NEW: WXShowroom.com is available: Show your projects!
More information on http://www.fabriceharari.com


On 6/27/2014 6:38 AM, Debzidoodle wrote:
> Thank you! Using an ansi string did the trick!