Subject Re: Post JSon Data
From Andreas Gehrs-Pahl <>
Date Sun, 19 Jan 2020 16:46:36 -0500
Newsgroups xb2net


It doesn't look like there is anything wrong with the Xb2Net request.

>Connection: Keep-Alive
>Connection: Close

If you want to change this, add this to your code:

>Content-Type: application/x-www-form-urlencoded;charset=UTF-8
>Content-Type: application/x-www-form-urlencoded

To change the Mime Type, add this to your code:
oForm:MimeType := "application/x-www-form-urlencoded;charset=UTF-8"

>User-Agent: Mozilla/4.0(compatible;MSIE6.0;Windows NT 5.0)
>User-Agent: Xb2.NET/

To change the User-Agent Header, you can add it explicitly when calling
the oHTTP:Execute() method. The same is true for the "Content-Type" Header,
if you don't make the "oForm" object your Content.


This is basically the same text, even though the actual values are different
in the second (Xb2Net) text line as per your code. Also the second line is
URL-encoded, replacing the characters {":,} with their %Hex Escape Codes.

>? oJ:AsString()
>it output  

The "=" in the output is actually a ":", but otherwise, your code looks

If you don't want to have the form data URL-encoded (escaped) (and also the
other headers updated), you can do this instead:

oResponse := oHttp:Execute("http://" + cServerIp + "/AIPersonCreate", ;
          "POST", XbUnEscape(oForm:AsString()), {{"Content-Type", ;
          "application/x-www-form-urlencoded;charset=UTF-8"}, ;
          {"User-Agent", "Mozilla/4.0(compatible;MSIE6.0;Windows NT 5.0)"}})

That should give you pretty much the same result as in your first option.

Hope that helps,

Andreas Gehrs-Pahl
Absolute Software, LLC

phone: (989) 723-9927

Recent messages in this thread
-# Post JSon Data Robert Tin 19-Jan-2020 08:08 am
.\# Re: Post JSon Data (Current message) Andreas Gehrs-Pahl 19-Jan-2020 04:46 pm