1. Praveen Rajarao
  2. PowerBuilder
  3. Wednesday, 22 November 2017

We have several REST Services we call and get result back as a JSON or an XML output. 

I have a new request to get back the RAW Bytes Array that it returns. How can I achieve that? 

For EG: 

We can do a GET for any image on the web like this one below:

https://randomuser.me/api/portraits/women/48.jpg

This returns back RAW data if you can check in Fiddler in the RAW tab. I need to capture that in PowerBuilder. 

Any ideas?

Accepted Answer
Marco Meoni Accepted Answer Pending Moderation
0
Votes
Undo

Hi,

you can use the iNet object and have the JPG stored as a blob in the internetresult::internetdata() function.

 

Inet  lo_inet
n_internetresult lo_iresult

If Parent.GetContextService( "Internet", lo_inet ) = 1 Then
    lo_iresult = CREATE n_internetresult
    li_rc = lo_inet.GetURL(ls_url_JPG, lo_iresult)
    .....

 

Cheers,

.m

Comment
Marco - I tried that just now..and it works. Thanks. 



 



 



 

  1. Praveen Rajarao
  2. Wednesday, 22 November 2017
There are no comments made yet.
  1. Wednesday, 22 November 2017
  2. PowerBuilder
  3. # Permalink
Chris Pollach Accepted Answer Pending Moderation
0
Votes
Undo

Hi Praveen;

     The RESTFul client & JSON  feature support are coming to PowerBuilder 2017 this December for the PB 2017R2 release.

Regards ... Chris

Comment
Hi Chris - Thanks for the info. I am still on PB12.5.2, convincing client to upgrade :-)

  1. Praveen Rajarao
  2. Wednesday, 22 November 2017
There are no comments made yet.
  1. Wednesday, 22 November 2017
  2. PowerBuilder
  3. # 1
  • Page :
  • 1


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