1. Robert Trifu
  2. PowerBuilder
  3. Thursday, 31 October 2024 09:26 AM UTC

Hi all,

We need to call a REST service in order to send some JSON content.

Sometimes after calling SendRequest, GetResponseStatusCode returns "-1" and GetResponseStatusText returns an empty string, but the JSON content was successfully sent.

This is confusing, because as GetResponseStatusCode did not returned the OK code "200", we show an error message even if the operation was successful.

Does anyone know what this "-1" code means ?

Thank you for your help.

Logan Liu @Appeon Accepted Answer Pending Moderation
  1. Friday, 1 November 2024 09:19 AM UTC
  2. PowerBuilder
  3. # 1

Hi Rob,

Please verify the return value of the SendRequest method. If the return value is 1 (Success), could you provide a small example that reproduces this issue?

There are several scenarios where the JSON data might be successfully sent to the server, but the client does not receive a response. Here are a few common reasons:

 

  • Network Issues: Sometimes, network problems can cause the response to be lost or delayed.

  • Server-Side Processing: The server might process the request but fail to send a response due to an internal error or misconfiguration.

  • Timeouts: If the server takes too long to respond, the client might time out and not wait for the response.

  • Firewalls or Security Software: These can sometimes block the response from reaching the client.

If you use Fiddler or other tools to capture the HTTP traffic, can you see the HTTP response code 200? 

 

Regards, Logan

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.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.