Example 2 (using RESTClient)
The RESTClient object sends a request with a header
“Accept-Encoding:gzip” which informs the RESTFul Web service that the
client can extract data; then the Web service returns a compressed
package and a response header “Content-Encoding: gzip” which indicates
that the data is compressed; and then the RESTClient object retrieves
data from the compressed package.
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
RestClient lrc_Client String ls_Url, ls_Method Long ll_rtn lrc_Client = Create RestClient ls_Url = "https://demo.appeon.com/pb/webapi_client/department" ls_Method = "GET" lrc_Client.SetRequestHeader ("Content-Type", "application/json") lrc_Client.SetRequestHeader("Accept-Encoding", "gzip") ll_rtn = lrc_Client.Retrieve( dw_1,ls_Url ) If ll_rtn >= 0 And lrc_Client.GetResponseStatusCode() = 200 Then MessageBox( "Retrieve Success","Rows:" + String ( ll_rtn )) Else MessageBox( "Retrieve Failed","Rows:" + String ( ll_rtn )) End If If IsValid (lrc_Client) Then Destroy ( lrc_Client ) |
Document get from Powerbuilder help
Thank you for watching.
Subscribe
Login
0 Comments
Oldest