1. Praveen Rajarao
  2. PowerBuilder
  3. Wednesday, 22 November 2017 14:21 PM UTC

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
  1. Wednesday, 22 November 2017 14:26 PM UTC
  2. PowerBuilder
  3. # Permalink

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
  1. Praveen Rajarao
  2. Wednesday, 22 November 2017 15:35 PM UTC
Marco - I tried that just now..and it works. Thanks. 



 



 



 

  1. Helpful
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 22 November 2017 14:46 PM UTC
  2. PowerBuilder
  3. # 1

Hi Praveen;

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

Regards ... Chris

Comment
  1. Praveen Rajarao
  2. Wednesday, 22 November 2017 15:36 PM UTC
Hi Chris - Thanks for the info. I am still on PB12.5.2, convincing client to upgrade :-)

  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.