1. SHAMEEM KAKKAD
  2. PowerBuilder
  3. Monday, 18 September 2023 12:16 PM UTC

HI,

I am Getting correct response from Post man. But from my PB Script not getting anything.. Below my script

link_ = 'http://000.00.00.00:2739/einvoice/web_updatelicensecommand?shaapiuser='+apiuser 
HttpClient shahttpclient
shahttpclient = Create HttpClient
jsoncontent_ = 'shacommand='+command_
ls_Basic = enc.base64encode( Blob(authuser + ":" + authpwd , EncodingUTF8!))
shahttpclient.SetRequestHeader( "Authorization", "Basic " + ls_Basic)
shahttpclient.SetRequestHeader("Content-Type", "application/x-www-form-urlencoded")
res_ = shahttpclient.SendRequest('PUT', link_,jsoncontent_)

What is the mistake with me ?

 

 

SHAMEEM KAKKAD Accepted Answer Pending Moderation
  1. Tuesday, 19 September 2023 06:50 AM UTC
  2. PowerBuilder
  3. # 1

BUt I am getting 200 while send from PB

Comment
  1. René Ullrich
  2. Tuesday, 19 September 2023 06:55 AM UTC
You've not posted some code for reading the response!?

  1. Helpful 1
There are no comments made yet.
mike S Accepted Answer Pending Moderation
  1. Monday, 18 September 2023 13:21 PM UTC
  2. PowerBuilder
  3. # 2

also, postman will auto generate some things like content length.  you have to send that in the header yourself if the rest api requires it

Comment
There are no comments made yet.
René Ullrich Accepted Answer Pending Moderation
  1. Monday, 18 September 2023 12:28 PM UTC
  2. PowerBuilder
  3. # 3

Your Postman shows a request using multipart/form-data. Your request from PB is application/x-www-form-urlencoded.

You can find different threads about sending multipart/form-data in this forum. There you can find how to use it.

HTH,

René

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.