1. Olivier LEROY
  2. PowerBuilder
  3. Friday, 18 October 2019 07:42 AM UTC

Hello

With PB 2019 and a RestClient object, I use the SendPostRequest function with -15 return (Unsupported character set).

No problem wtih the SendGetRequest function witch use the same token acces.

I had follow the PB example : 

RestClient_Yvidya.SetRequestHeaders("Content-Type:application/json;charset=UTF-8~r~nAccept-Encoding:gzip")

Retour = RestClient_Yvidya.SendPostRequest(url_deb + url_api, param, Reponse_Yvidya)

Where param is a tested Json string.

Is somebody has a idea ?

 

Olivier

 

 

 

 

Armeen Mazda @Appeon Accepted Answer Pending Moderation
  1. Friday, 18 October 2019 17:51 PM UTC
  2. PowerBuilder
  3. # 1

As a troubleshooting step, try removing the charset and gzip options (maybe the API you are calling doesn't like that):

RestClient_Yvidya.SetRequestHeaders("content-type:application/json") 

Comment
  1. Olivier LEROY
  2. Tuesday, 22 October 2019 07:21 AM UTC
Hi Armeen

thanks for the advice, I had try it before without succes.

PB help say that UTF8 is the default encoding and httpclient with UTF8 encoding for the blob is OK.

The PUT with HTTPclient is Ok, so it's a way for me, but is somebody use the SendPostRequest with success ?

  1. Helpful
  1. Armeen Mazda @Appeon
  2. Tuesday, 22 October 2019 17:02 PM UTC
I see. Sorry, I don't have any other suggestions. Let's see if somebody else can help.
  1. Helpful
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Friday, 18 October 2019 16:35 PM UTC
  2. PowerBuilder
  3. # 2

Hi Olivier;

  Could there be some binary data that needs to be converted into Base64 ... That the Web Service is expecting it in that format?

Regards ... Chris

Comment
  1. Olivier LEROY
  2. Tuesday, 22 October 2019 07:23 AM UTC
Hi Chris

Thank you for your reply, I send a json string and the same one is OK with the HttpClient and Put option.

So, i have a way, but i would prefere to use the SendPostRequest fonction...
  1. Helpful
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.