HttpClient Error getting response stream (ReadDone1): ReceiveFailure - mono

I am using HttpClient class to make a web request to get data from server( httpClient.GetAsync(url, HttpCompletionOption.ResponseContentRead). But randomly i get this error saying Error getting response stream (ReadDone1): ReceiveFailure I have a try catch block around this call but it does not get caught. Instead I get the error in UIApplication.Main(args, null, "AppDelegate"); in the IOS App. Is there any way to catch this error or to fix this error?

Are you using ModernHttpClient? If not, give it a shot. It's available as a component and on github. It's a drop in replacement for HttpClient that performs a lot better.

Related

Postwoman API Tester response is always empty

Postwoman (now Hoppscotch) is an API request builder (like Postman) that I love the idea of because it's open source, but I'm not getting any response showing up in the Response field. It's a private API I'm hitting so I'd rather not show my request but it's a POST and my API is sending back the correct response (that works fine in Postman). I'm seeing the following error in the browser console:
TypeError: text.match is not a function
Is anybody else having this problem?
Adding browser extension:
https://addons.mozilla.org/en-US/firefox/addon/hoppscotch/
done the trick for me

Network request failed in React native using Fetch API

I'm using fetch API to get data from server using POST method. It return an error: Network request failure. when I try with a Facebook movie API it works good, then I try it with Postman width same key and userId and everything is okay
this is what I have when I click on the TestAPI button
this is result in Postman width same configurations
The response that you are showing does not seems to be a JSON object (see the encoding issues) so when you try to do response.json() most likely fails because it can't parse it.
Try to log the response or do response.text() instead of response.json() to try it out.
Seems like your problem is on your php server code.

ServerXMLHTTP fails on unresolvable ul

We are using the MSXML2.ServerXMLHTTP60Class to make HTTP requests. Usually this works fine, but on some occasions when the url cannot be resolved, the send method fails. In this case an exception is thrown.
The problem is that we program in Microsoft Dynamcs NAV C/AL code. This language does not support error trapping (try catch).
Does anybody know if there is some setting in the ServerXMLHTTP60Class that prevents the send method from failing?
Note: the send method fails, so checking the response status is not an option.
Thank you!
Depend your on version of Nav you have different ways to handle exeptions.
In Nav 2016 there will be try function
In previous versions you should use if codeunit.run then syntax to catch the exception and getlasterrortext to get error message.
For more information read Vjeco
Another option to avoid unhandled exceptions is to write a wrapper class around ServerXMLHTTP60Class that will catch all exceptions and handle them in the way you like.

Google Bigquery Backend Error with streaming inserts but not display in console

I am getting following error from Google bigquer while doing streaming inserts:
Error message Signet::AuthorizationError: Unexpected status code: 500. Server message: { "error": "internal_failure" }
I can understand that there can few errors but the same doesn't get reflected on console as shown below:
As you can see in above, image, there are no 500 errors but yet in real there were 10 500 internal_failure errors.
Can you tell me why these errors don't refect on console & how do I ensure they don't happen?
This looks like a failiure to get your authentication token. This failure would occur before the client code even attempts to call the bigquery api, so the console you are looking at is accurately representing traffic.
I suspect it is a failure on a request to https://accounts.google.com/o/oauth2/token. Perhaps monitoring on outgoing http requests could verify this? (For example, see Getting error 500 when trying to obtain access token from authorization code and Internal_failure while getting refreshtoken using code?)
Back to the BigQuery API: when it returns an http error code 500, the error string will be one of "backendError" or "internalError". (For the curious: "backendError" is usually retriable, while "internalError" is likely a permanent failure.)

Apache Abdera Client Response getDocument method

I am using client response interface of apache abdera. I want to see what data the server returns me in the response object. I tried using the getDocument() method of response object but it throws me an exception as follows:
Exception in thread "main" java.lang.NoSuchMethodError: org.apache.axiom.om.util.StAXUtils.getXMLInputFactory(Lorg/apache/axiom/om/util/StAXParserConfiguration;)Ljavax/xml/stream/XMLInputFactory;
at org.apache.abdera.parser.stax.FOMParser.getXMLInputFactory(FOMParser.java:152)
at org.apache.abdera.parser.stax.FOMParser.createXMLStreamReader(FOMParser.java:178)
at org.apache.abdera.parser.stax.FOMParser.parse(FOMParser.java:143)
at org.apache.abdera.protocol.client.AbstractClientResponse.getDocument(AbstractClientResponse.java:111)
at org.apache.abdera.protocol.client.AbstractClientResponse.getDocument(AbstractClientResponse.java:89)
at org.apache.abdera.protocol.client.AbstractClientResponse.getDocument(AbstractClientResponse.java:71)
Does anyone know a way to read the conents of response object?
Thanks
I've faced the same problem under different circumstanes. After some investigations I've found out, that problem is in wrong compile-time/runtime Axiom version (1.2.5 vs 1.2.10);
Filed
https://issues.apache.org/jira/browse/ABDERA-284
I've attached proposed fix (ABDERA-284-fix.diff), that worked fine for me to the bug.