Skip to Content
avatar image
Former Member

How to capture response from a server in PowerBuilder

Consider that we have a server which when triggered with a URL (with data within the URL), the Server responds by creating a PDF file.

In PowerBuilder tool, we trigger the URL via PostURL():

int ll_return
inet_base = CREATE inet
ll_return = inet_base.postURL('http://server:8080/postRender?', Blob, header string, port#, internetData)

In the postURL argument, the Blob is the data that was appended to the URL. The data is converted to blob and then passed as an argument.

The details of the postURL function is in below link:http://infocenter-archive.sybase.com/help/index.jsp?topic=/com.sybase.dc37781_1150/html/psref/CCJCIIFD.htm

Consider that the server returns 404 code with some message like: File not found!

I need help to write the PowerBuilder code to capture the response of the server. Currently, since we are using PostURL function to trigger POST request, in return I am getting only integers such as:

  • 1 Success
  • -1 General error
  • -2 Invalid URL
  • -4 Cannot connect to the Internet
  • -5 Unsupported secure (HTTPS) connection attempted
  • -6 Internet request failed
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Apr 05, 2017 at 04:35 PM

    The InternetResult object should receive the server's 404 error page as a string of html.

    Add comment
    10|10000 characters needed characters exceeded