1. Miller Rhodes
  2. SnapDevelop
  3. Wednesday, 18 March 2020 21:24 PM UTC

On my current project we have been making extensive use of the RestClient and HttpClient to make API

calls from PB 2019 to various Controllers in SnapObjects.  

You can send datastores, strings, numbers, etc to through these calls as parameters.

What we have not been able to do is send arrays or rather we don't know how to send them.

 

Has anyone done this ?  Could you paste an example ?

 

Miller

Accepted Answer
Mark Lee @Appeon Accepted Answer Pending Moderation
  1. Thursday, 19 March 2020 08:56 AM UTC
  2. SnapDevelop
  3. # Permalink

Hi Miller,

 

I suggest you download our demo code from Github. The demo is also to show you how to use the RestClient and HttpClient to make API calls from PB 2019 R2 Beta to various Controllers in SnapObjects.

C# code

https://github.com/Appeon/.NET-DataStore-Example 

PB code:

https://github.com/Appeon/PowerBuilder-RestClient-Example 

databse:

https://github.com/Appeon/.NET-Project-Example-Database 

 

Regards,

Comment
There are no comments made yet.
Miller Rhodes Accepted Answer Pending Moderation
  1. Thursday, 19 March 2020 13:51 PM UTC
  2. SnapDevelop
  3. # 1

Mike S,

 

Can you provide a sample RestClient call or HTTPClient call with a json as an example

Comment
  1. mike S
  2. Thursday, 19 March 2020 16:52 PM UTC
http.SendRequest ( methodName, urlName, <YourJsonData> )



You send the json array (or any data) as DATA (request body), not part of the url.





  1. Helpful
There are no comments made yet.
mike S Accepted Answer Pending Moderation
  1. Wednesday, 18 March 2020 23:09 PM UTC
  2. SnapDevelop
  3. # 2

send them as json arrays

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.