如何从NSerror获取header参数的值?

时间:2015-02-12 08:59:40

标签: ios objective-c error-handling afnetworking

我是目标C的新手,我想从NSError获取有用的信息。我想从服务器发送的错误消息的标头参数中获取密钥“errorMessage”的值。我正在使用AFNetworking。当我打印出[错误userInfo]时,它显示如下:

{
   status code: 417, headers {\n    \"Content-Length\" = 0;\n    \"Content-Type\" = \"application/json\";\n    Date = \"Thu, 12 Feb 2015 08:37:08 GMT\";\n    Server = \"Apache-Coyote/1.1\";\n    errorCode = ORD012;\n    errorMessage = \"Couldn't found suitable client at this moment\";\n}
}";

谢谢!

0 个答案:

没有答案