We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I have the following construction:
[[UNIRest get:^(UNISimpleRequest *request) { [request setUrl:url]; [request setHeaders:headers]; }] asJsonAsync:^(UNIHTTPJsonResponse* response, NSError *error) { }];
Sometimes a web service returns HTTP "204 No Content" with an empty message-body. It causes the error in json-searilization:
id json = [NSJSONSerialization JSONObjectWithData:[httpResponse rawBody] options:NSJSONReadingMutableLeaves error:&error];
in UNIHTTPJsonResponse implementation.
Plus, it returns HTTP status code 0, instead of 204.
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'data parameter is nil' *** First throw call stack: ( 0 CoreFoundation 0x000000010df73c65 __exceptionPreprocess + 165 1 libobjc.A.dylib 0x000000010dc0cbb7 objc_exception_throw + 45 2 CoreFoundation 0x000000010df73b9d +[NSException raise:format:] + 205 3 Foundation 0x000000010d8a97ef +[NSJSONSerialization JSONObjectWithData:options:error:] + 67 4 MYAPP 0x000000010bbdaef5 -[UNIHTTPJsonResponse initWithSimpleResponse:] + 453 5 MYAPP 0x000000010bbdbfe8 __30-[UNIHTTPRequest asJsonAsync:]_block_invoke + 200 6 MYAPP 0x000000010bbdaac3 __44+[UNIHTTPClientHelper requestAsync:handler:]_block_invoke + 179 7 MYAPP 0x000000010bbdebd9 __47-[UNIUrlConnection connectionDidFinishLoading:]_block_invoke + 89 8 Foundation 0x000000010d84557f __NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK__ + 7 9 Foundation 0x000000010d7860b2 -[NSBlockOperation main] + 98 10 Foundation 0x000000010d768774 -[__NSOperationInternal _start:] + 645 11 Foundation 0x000000010d768383 __NSOQSchedule_f + 184 12 libdispatch.dylib 0x000000010e586614 _dispatch_client_callout + 8 13 libdispatch.dylib 0x000000010e56d6a7 _dispatch_queue_drain + 2176 14 libdispatch.dylib 0x000000010e56ccc0 _dispatch_queue_invoke + 235 15 libdispatch.dylib 0x000000010e5703b9 _dispatch_root_queue_drain + 1359 16 libdispatch.dylib 0x000000010e571b17 _dispatch_worker_thread3 + 111 17 libsystem_pthread.dylib 0x000000010e8f3637 _pthread_wqthread + 729 18 libsystem_pthread.dylib 0x000000010e8f140d start_wqthread + 13 ) libc++abi.dylib: terminating with uncaught exception of type NSException
The text was updated successfully, but these errors were encountered:
Same problem with HTTP status code 401. The library returns status 0.
Sorry, something went wrong.
A pull-request #31 fixes it.
I seem to still be getting return status 0 on 401s when I build with pull-request #31.
Are you sure you’ve loaded it the pull-request #31? I’ve used it in a couple of projects and I've never had a problem with it.
It worked fine for me with pull-request #31. Thanks.
Any plans to roll this fix into a new Podspec? Not sure if this library is still supported. Thanks.
No branches or pull requests
I have the following construction:
Sometimes a web service returns HTTP "204 No Content" with an empty message-body. It causes the error in json-searilization:
in UNIHTTPJsonResponse implementation.
Plus, it returns HTTP status code 0, instead of 204.
The text was updated successfully, but these errors were encountered: