vendredi 8 mai 2015

Double quotes not showing up in string value inside NSMutableDictionary [duplicate]

I'm trying to post some json content to server using REST apis. On POST request, server is accepting the content value like the one given below in body

{
    "value" = "MyDataValue";
}

But after creating the web request, when I try to log the POST data, what I'm getting in console output is

{
    "value" = MyDataValue;
}

Note: No double quotes around MyDataValue.

On trying the same request with double quotes on chrome poster returns success and without double quotes returns same error in poster also. So I guess adding double quotes would solve the issue.

Here is the code I used for creating the NSDictionary

NSMutableDictionary *parameterDict = [NSMutableDictionary new];  
[parameterDict setObject:@"MyDataValue"forKey:@"value"];

Also, tried adding double quotes using escape character, but returns in 2 double quotes which also returns error. So any other alternative solution would be helpful.

Thanks.

Aucun commentaire:

Enregistrer un commentaire