PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV Mobile 2024 → HTTPRequest Post data truncated
HTTPRequest Post data truncated
Débuté par Debzidoodle, 27 juin 2014 04:54 - 3 réponses
Posté le 27 juin 2014 - 04:54
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
Posté le 27 juin 2014 - 12:48
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
Posté le 27 juin 2014 - 14:38
Thank you! Using an ansi string did the trick!
Posté le 27 juin 2014 - 15:21
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!