NSDebugDescription = "JSON text did not start with array or object and option to allow fragments not set."; NSDebugDescription = "JSON text did not start with array or object and option to allow fragments not set."; ios ios

NSDebugDescription = "JSON text did not start with array or object and option to allow fragments not set.";


First thing, json_encode the entire object rather than breaking into it pieces.

Secondly, unless $arr contains multiple elements (not clear from example above), it should be initalized as thus:

$arr = array("Message" => "update succeeded");

I'm still not certain what else could be the issue here. You should echo out what your app is receiving and that should indicate the issue.


Please use acceptable content type.in your webservice that should be only plain text.

here is my swift code and fixed:

    let manager = AFHTTPRequestOperationManager()    manager.requestSerializer=AFJSONRequestSerializer()    manager.responseSerializer = AFHTTPResponseSerializer();    manager.GET(        baseURL + (webServiceType as String) + secureParam,        parameters:[:],        success:        { (operation: AFHTTPRequestOperation!,            responseObject: AnyObject!) in            completion(obj: responseObject)        },        failure:        { (operation: AFHTTPRequestOperation!,            error: NSError!) in            completion(obj: nil)    })


Check you have added /api/ before your base url of API like

http:// someurl / yourBasrUrl /api/apiName