I receive this error when I tried to signup an account with the app im building. May I know what does this error means? Thank you!
BaseNetworkManager.m:164 Error Domain=AFNetworkingErrorDomain Code=-1011
"Expected status code in (200-299), got 500" UserInfo=0x16d30560
{NSLocalizedRecoverySuggestion=meta http-equiv="refresh" content="0;
url =websitelink.error.html"
AFNetworkingOperationFailingURLRequestErrorKey=NSMutableURLRequest: 0x16670d80> { URL: mywebsite/users.json }, NSErrorFailingURLKey=h mywebsite.com/users.json, NSLocalizedDescription=Expected status code in (200-299), got 500, AFNetworkingOperationFailingURLResponseErrorKey=<NSHTTPURLResponse: 0x1669fe20> { URL: mywebsite.com/users.json } { status code: 500, headers {
Connection = "keep-alive";
"Content-Length" = 690;
"Content-Type" = "text/html; charset=utf-8";
Date = "Fri, 01 May 2015 12:37:44 GMT";
Server = Cowboy;
Status = "500 Internal Server Error";
Via = "1.1 vegur";
"X-Rack-Cache" = "invalidate, pass";
"X-Request-Id" = "tyud";
"X-Runtime" = "5.087065"; } }}
2015-05-01 20:37:45.002 appname[1677:60b] <BaseNetworkManager.m:165> (null)
The server is telling you
500 Internal Server Error
this means that the server has a problem that is not your fault. (unless you are the one who is responsible for the server.)
HTTP 200..299 means "ok"
HTTP 300..399 means "look somewhere else"
HTTP 400..499 means "there is a problem with your request." for example 404=file not found, 403=forbidden, etc.
HTTP 500..599 means "the server has a problem / is misconfigured"
see http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html for more info.
Related
I have simple API developed in Slim, which is stored in Online Server. It works fine when I check it from browser, but when I retrieve it from Iphone app, it show me the following error:
PeopleAlsoAsk[12607:2219389] Error Domain=AFNetworkingErrorDomain Code=-1011 "Expected status code in (200-299), got 500" UserInfo={NSLocalizedRecoverySuggestion="this is index pagpe, Specific questions are retrieved successfully", NSErrorFailingURLKey=http://upvc.pk/test2/public/, AFNetworkingOperationFailingURLRequestErrorKey=<NSMutableURLRequest: 0x608000001060> { URL: http://upvc.pk/test2/public/ }, AFNetworkingOperationFailingURLResponseErrorKey=<NSHTTPURLResponse: 0x60800003d6c0> { URL: http://upvc.pk/test2/public/ } { status code: 500, headers {
"Accept-Ranges" = bytes;
Connection = "Keep-Alive";
"Content-Encoding" = gzip;
"Content-Length" = 81;
Date = "Wed, 26 Apr 2017 12:34:31 GMT";
Server = LiteSpeed;
Vary = "Accept-Encoding";
"X-Powered-By" = "PHP/7.0.17";
} }, NSLocalizedDescription=Expected status code in (200-299), got 500}
2017-04-26 17:34:31.462 PeopleAlsoAsk[12607:2219389] Error function called
I tried a lot, but all in vain. If any one faced this problem, or know about this, then please guide me in this. Thanks in advance.
My code is given below
public/index.php
<?php
use \Psr\Http\Message\ServerRequestInterface as Request;
use \Psr\Http\Message\ResponseInterface as Response;
require '../vendor/autoload.php';
$app = new \Slim\App;
//Questions Routes
require '../src/routes/questions.php';
$app->run();
routes/questions.php
<?php
use \Psr\Http\Message\ServerRequestInterface as Request;
use \Psr\Http\Message\ResponseInterface as Response;
$app = new \Slim\App;
//Get All Questions
$app->get('/api/questions', function(Request $request, Response $response){
$questions = "All questions are retrieved successfully";
echo json_encode($questions);
});
// Get specific Questions
$app->get('/api/questions/{app_id}', function(Request $request, Response $response){
$questions = "Specific questions are retrieved successfully";
echo json_encode($questions);
});
You should put your iOS code here.
From your Slim, I would place:
$app->status($status_code);
In your response code, you can add this function to give all client response:
function echoResponse($status_code, $response) {
$app = \Slim\Slim::getInstance();
// Http response code
$app->status($status_code);
// setting response content type to json
$app->contentType('application/json');
echo json_encode($response);
}
Usage very simple:
echoResponse(200, "your response");
From iOS point of view, hard to say something without the code.
I have been able to authenticate with the Pinterest API on both the javascript and Android SDK. On iOS, I've triple-checked all of my settings to make sure I've configured everything according to the documentation.
However, when I log in through iOS, I am taken to the Pinterest app to authorize and all looks good. However, when Pinterest passes me back to my app, I am getting the following login error:
Error Domain=com.alamofire.error.serialization.response Code=-1011 "Request failed: unauthorized (401)" UserInfo={com.alamofire.serialization.response.error.response=<NSHTTPURLResponse: 0x17403dea0> { URL: https://api.pinterest.com/v1/oauth/inspect?access_token=AYalMni-yTq5Y0UihwETrFxZpzL5FK2tXvfmkbhDyJ_OP8BGeQAAAAA&token=AYalMni-yTq5Y0UihwETrFxZpzL5FK2tXvfmkbhDyJ_OP8BGeQAAAAA } { status code: 401, headers {
Age = 0;
"Cache-Control" = private;
Connection = "keep-alive";
"Content-Length" = 177;
"Content-Type" = "application/json";
Date = "Mon, 20 Mar 2017 19:21:15 GMT";
"Pinterest-Generated-By" = "devplatform-devapi-prod-0a01239b";
"Pinterest-Version" = 918ef75;
"X-Content-Type-Options" = nosniff;
"X-Pinterest-RID" = 280542321780;
} }, NSErrorFailingURLKey=https://api.pinterest.com/v1/oauth/inspect?access_token=AYalMni-yTq5Y0UihwETrFxZpzL5FK2tXvfmkbhDyJ_OP8BGeQAAAAA&token=AYalMni-yTq5Y0UihwETrFxZpzL5FK2tXvfmkbhDyJ_OP8BGeQAAAAA, com.alamofire.serialization.response.error.data=<7b227374 61747573 223a2022 6661696c 75726522 2c202263 6f646522 3a20332c 2022686f 7374223a 20226465 76706c61 74666f72 6d2d6465 76617069 2d70726f 642d3061 30313233 3962222c 20226765 6e657261 7465645f 6174223a 20224d6f 6e2c2032 30204d61 72203230 31372031 393a3231 3a313520 2b303030 30222c20 226d6573 73616765 223a2022 41757468 6f72697a 6174696f 6e206661 696c6564 2e222c20 22646174 61223a20 6e756c6c 7d>, NSLocalizedDescription=Request failed: unauthorized (401)}
I tried taking the access token referred to in the error response and using the token debugger on the Pinterest developer site to check it, but when I did so I got the message "An error occurred. Please try again."
So, I'm stumped. It seems to me that the access token that's being generated on iOS login is being seen as invalid by Pinterest, but I don't know how to fix that.
Do you have any thoughts on what can be done to resolve this?
Im getting this error while posting image to Pinterest
Domain=com.alamofire.error.serialization.response Code=-1011 "Request failed: unauthorized (401)" UserInfo={com.alamofire.serialization.response.error.response=<NSHTTPURLResponse: 0x144603bd0> { URL: https://api.pinterest.com/v1/pins/ } { status code: 401, headers {
"Accept-Ranges" = bytes;
"Cache-Control" = private;
Connection = close;
"Content-Length" = 177;
"Content-Type" = "application/json";
Date = "Sun, 10 Jul 2016 19:38:00 GMT";
"Pinterest-Generated-By" = "devplatform-devapi-prod-de3d740a";
"Pinterest-Version" = bcdafd3;
Server = nginx;
"X-Content-Type-Options" = nosniff;
"X-Pinterest-RID" = 480720869025;
"X-Varnish" = 2958547338;
} }, NSErrorFailingURLKey=https://api.pinterest.com/v1/pins/, com.alamofire.serialization.response.error.data=<7b227374 61747573 223a2022 6661696c 75726522 2c202263 6f646522 3a20332c 2022686f 7374223a 20226465 76706c61 74666f72 6d2d6465 76617069 2d70726f 642d6465 33643734 3061222c 20226765 6e657261 7465645f 6174223a 20225375 6e2c2031 30204a75 6c203230 31362031 393a3338 3a303020 2b303030 30222c20 226d6573 73616765 223a2022 41757468 6f72697a 6174696f 6e206661 696c6564 2e222c20 22646174 61223a20 6e756c6c 7d>, NSLocalizedDescription=Request failed: unauthorized (401)}
Here is my code:
PDKClient.sharedInstance().createPinWithImage(image, link: NSURL(string:"http://domain"), onBoard: "MyBoard", description: caption, progress: {percent in
print(percent)
}, withSuccess: {PDKResponseObject in
print("ok")
print(PDKResponseObject.boards())
}, andFailure: {error in
print(error)
})
Error 401 means one of the following.
1.Authentication failed.
2.Authorization failed.
3.You are not permitted to access that resource.
Double check your permissions, check your session token expired or not.
So I think that there is nothing wrong with your code, or the request. It's something with the permissions you have in your Pinterest app.
Try changing the request URL from http to https.
Check the parameters you sending to Pinterest, check whether the parameter names are correct or not, as specified in Pinterest documentation. Also those parameters has the proper type of data, I mean do not pass String in the place of Integer value.
.
I have one issue facebook signing with quickblox api.
After getting AccessToken by using FBSDK.
[QBRequest logInWithSocialProvider:#"facebook" accessToken:accessToken accessTokenSecret:nil successBlock:^(QBResponse *response, QBUUser *user) {
} errorBlock:^(QBResponse *response) {}
i think facebook returns correct token string.
CAAVS4qDIQb4BAMS7pTl3P1EmtW1ZCOOpbTCQFWrBI8QsA7ufOTYapjF3rEpW1ojZChgOZB7mj6AWDocDSdtxFbksqP3FyZCIou6bUC6ON4ZCRFGPes6TBzufh68A9fBSSz6baTYCZCTIyZAoDhYdBZAvrHF3609cAiEZCesnWrtqYleqPv7YHIadrWf2x1oWItypF3V3pbDgsHd7MSSCcZBvK4yuHGeCUvf7qMPFznuRZCfwNCOcQBDU8ynHnzDPpnnhLEZD
[logInWithSocialProvider: accessToken: ...] function returns following error
[QBResponse], status: 422
2015-12-09 14:27:27.049 NudgeBuddies[2598:124844] [QBCore] Response error: Error Domain=com.alamofire.error.serialization.response Code=-1011 "Request failed: client error (422)" UserInfo={com.alamofire.serialization.response.error.response=<NSHTTPURLResponse: 0x7ffde266ce40> { URL: https://api.quickblox.com/login.json } { status code: 422, headers {
"Access-Control-Allow-Origin" = "*";
"Cache-Control" = "no-cache";
Connection = "keep-alive";
"Content-Length" = 47;
"Content-Type" = "application/json; charset=utf-8";
Date = "Wed, 09 Dec 2015 06:27:26 GMT";
"QB-Token-ExpirationDate" = "2015-12-09 08:27:26 UTC";
"QuickBlox-REST-API-Version" = "0.1.1";
Server = "nginx/1.6.2";
Status = "422 Unprocessable Entity";
"X-Rack-Cache" = "invalidate, pass";
"X-Request-Id" = ab3443c24c0d5ee0a18d796eaf996cb7;
"X-Runtime" = "0.221723";
"X-UA-Compatible" = "IE=Edge,chrome=1";
} }, NSErrorFailingURLKey=https://api.quickblox.com/login.json, com.alamofire.serialization.response.error.data=<7b226572 726f7273 223a7b22 62617365 223a5b22 4c6f6769 6e206f72 20656d61 696c2072 65717569 72656422 5d7d7d>, NSLocalizedDescription=Request failed: client error (422)}
Please Help me.
How can i solve this problem?
Regards.
In QuickBlox SDK 2.6.5 we have improved stability and we have enabled detail logging so you are able to see the reasons why problem happens.
QuickBlox has open source project Q-municate with Facebook login and you can check it by yourself.
Thanks!
i am trying to make a request to a SOAP web service with the code below.
BasicHttpBinding_IGTBEihaleWSBinding *binding = [GTBEIhaleWSSvc BasicHttpBinding_IGTBEihaleWSBinding];
binding.logXMLInOut = YES;
GTBEIhaleWSSvc_IhaleListesiGetir *request = [GTBEIhaleWSSvc_IhaleListesiGetir new];
BasicHttpBinding_IGTBEihaleWSBindingResponse *response = [binding IhaleListesiGetirUsingParameters:request];
NSArray *responseHeaders = response.headers;
NSArray *responseBodyParts = response.bodyParts;
However, i am getting this error.
2014-02-21 11:33:36.348 Mobil Ihale Uygulamasi[22801:70b] ResponseStatus: 500
2014-02-21 11:33:36.349 Mobil Ihale Uygulamasi[22801:70b] ResponseHeaders:
{
Connection = close;
"Content-Length" = 449;
"Content-Type" = "text/xml;charset=UTF-8";
Date = "Fri, 21 Feb 2014 09:33:21 GMT";
Server = "Apache-Coyote/1.1";
}
2014-02-21 11:33:36.350 Mobil Ihale Uygulamasi[22801:70b] ResponseError:
Error Domain=BasicHttpBinding_IGTBEihaleWSBindingResponseHTTP Code=500 "internal server error" UserInfo=0x10923ce40 {NSLocalizedDescription=internal server error}
I don't have a problem with another SOAP service with this approach.
The cause of the problem is about wsdl2objc's parsing. Something is wrong with the generated code. Thus, I found another tool named Easy WSDL. It just worked perfect for me.