I'm using ASIHttpRequest, on iOS, to upload a file. In some cases, the user can't upload the file (because some conditions aren't fulfilled), so my server needs to return an error (400 status code) with a custom header. When it's happen, the ASIHttpRequest fails but with no status code and response headers ...
But it's only for large data (more than 1M). For smaller data, it's work. I've digged in the source and find that when the server returns 400 before all data were sent, CFNetwork returns a kCFStreamEventErrorOccurred and from here, it's impossible to read other thing than the error in the read stream. But if the request failed after all data were sent, it send a kCFStreamEventEndEncountered and from here, status code and response readers can be read.
As ASIHttpRequest is discontinued, I would like to fix it myself but I haven't find how to do it. I fear that it's a CFNetwork limitation ... I've find nothing about that on the internet or the documentation ...
Does anyone know how to handle that ? Or know enough about CFNetwork to give me some leads ?
Thanks !