Subject Post JSon Data
From Robert Tin <>
Date Sun, 19 Jan 2020 08:08:45 -0500
Newsgroups xb2net

If I use other tools to post JSon data to a server, it work OK and the related HTTP Request Header will show ..

POST /AIPersonCreate HTTP/1.1
User-Agent: Mozilla/4.0(compatible;MSIE6.0;Windows NT 5.0)
Connection: Keep-Alive
Content-Type: application/x-www-form-urlencoded;charset=UTF-8
Content-Length: 67


If I use to post JSon data and server return failed, the related HTTP header show ..

POST /AIPersonCreate HTTP/1.1
User-Agent: Xb2.NET/
Accept: */*
Connection: Close
Cache-Control: no-cache
Content-Type: application/x-www-form-urlencoded
Content-Length: 106


My code is following ..
  oForm := xbForm():new()
  oForm:SetVar("pass", "12345678")

  oJ := xbJSON():new()
  oJ:AddVar("idcardnum","222222" )
  ? oJ:AsString()
  // it output  
  // {"id"="p2","name":"test2t","idcardNum":"222222"}

  oForm:SetVar( "person", oJ:AsString() )
  oResponse := oHttp:Execute("http://" + cServerIp + "/AIPersonCreate","POST",oForm )

Any suggestion ?


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