ios - "Expected status code in (200-299), got 404" -
this code:
nsurl *url = [nsurl urlwithstring:@"http://wspublisherv2.skygiraffe.com/wspublisherv2.svc/authenticate"]; afhttpclient *client = [[afhttpclient alloc]initwithbaseurl:url]; nsdictionary *parameters = [nsdictionary dictionarywithobjectsandkeys:@"john@sgdemo.com", @"username", @"123", @"password", nil]; nslog(@"%@", parameters); [client postpath:nil parameters:parameters success:^(afhttprequestoperation *operation, id responseobject) { nslog(@"success: %@", responseobject); } failure:^(afhttprequestoperation *operation, nserror *error) { nslog(@"failure: %@", error); }];
it triggers failure block , "expected status code in (200-299), got 404" message.
when try through fiddler works.
you need more information. use proxy charles proxy watch traffic between device , server. that'll let see actual request. can compare request works, , difference should give pretty idea of what's wrong. @ least, it'll make question more specific.
Comments
Post a Comment