ASIHTTPRequestErrorDomain Code=4 "The request was cancelled" - asihttprequest

I got "Error Domain=ASIHTTPRequestErrorDomain Code=4 \"The request was cancelled\" exception. but I do not cancel the request.
How could it be?

By default, if a request running in a queue fails, all other requests in the queue will be cancelled.
You can disable this with:
[queue setShouldCancelAllRequestsOnFailure:NO];

Related

Asp,net Core Controller Action body timeout

So I am receiving a Shopify webhook request to my asp.net application. I keep getting the following error.
'((Microsoft.AspNetCore.Http.DefaultHttpRequest)this.Request).Form' threw an exception of type 'System.InvalidOperationException'
If I put Request.Body it says item timed out. I am not sure how to read the stream that is getting sent to my action.
I can post any extra details you request I am not sure what to post here.
This we because I needed to read the incoming stream.

BizTalk behaviour Http Send Adaptor when receiving a 400 or 500

If my Http Send adaptor receives an http 500 I want to retry. If it returns a 400 I don't want it to retry. Instead I want to subscribe to the message and email it somewhere.
It seems that the Http Send adaptor automatically retries in everything but a 200 and when it is a 400 or 500 does not appear to publish the response message. Am I missing something here?
Unfortunately that is it's expected behaviour. It is something I wrote about as a missing feature in my blog article BizTalk 2013 R2 known bugs, issues & quirks (excerpt below), as there was also an issue with the way it throws the error after the retries have finished. The workaround would be to set retries to zero and have an Orchestration or code another retry mechanism.
MISSING: BIZTALK WCF-WEBHTTP ADAPTER ABILITY TO SUPPRESS 404 STATUS CODE
Details: When you do a get on a RESTful service and get a 404 status code and a payload saying that the object you asked for does not exists, it will throw a SOAP exception. It would be nice to be able to suppress a 404 status code (or other status codes) on a GET (or other operations) and to parse the response as normal through the pipeline and process as business exception rather than a System Exception.
Work around: Catch the exception in an Orchestration and look for the not found error description that the service threw.

How to not retry a Scrapy request?

Sometimes I don't want to retry on an error in a Scrapy request since I am only checking if the page exists. How to not retry a request?
It turns out it has dont_retry argument.
Request('myurl', callback=self.method_to_parse, meta={'dont_retry':True})

Validation of a user registration request should return 200 or 400

The client sends a perfectly valid request for a user registration, e.g. username & password.
The server finds out that the username is already taken. What's the correct return status - 200 with an error message, or 400? The spec says:
400 implies that something was wrong with the request.
The HyperText Transfer Protocol (HTTP) 400 Bad Request response status
code indicates that the server cannot or will not process the request
due to something that is perceived to be a client error (e.g.,
malformed request syntax, invalid request message framing, or
deceptive request routing).
But technically there's nothing wrong with the request.
What is 'wrong' is that the request was intended to create a new user, but that failed because the username was already taken. This is definitely in the category 'client error'. Rather than seeing 'client error' as 'there is a bug', it's better to think of it was 'for one reason or another the request failed, and it's up to the client to make a correction'.
A typical error code for this specific situation might be 409 Conflict.
If you sent back 200, the client should perceive the result as "My request completed successfully", which is definitely not the case here.

How can I execute concurrent HTTP requests in Paw?

In Paw if I have a long running request and attempt to invoke another I'm presented with a dialog that says Stop request? A request is currently running. with the options Cancel, Stop and Stop & Send. How can I keep the first request running and invoke another without canceling the first request?

Resources