I'm trying to execute a GET requst with json object binded to it , This i how i generated JSON object
let jsonObject: [String: AnyObject] = [
"ean_code": [
"type": "match",
"value": "16743799"
]
]
and then I executed the request
like this
Alamofire.request(.GET,Constant.WebClient.WS_URL + "/product?filters="+String(jsonObject),parameters:parameters)
but this gave me an error which is canot bind the URL with invalid character
so i encoded the URL from this
let request = String(jsonObject).stringByAddingPercentEncodingWithAllowedCharacters(NSCharacterSet.URLPasswordAllowedCharacterSet())!
this will encode the URL but i again this will give me following error
Request failed with error: Error Domain=NSCocoaErrorDomain Code=3840 "Invalid value around character 0." UserInfo={NSDebugDescription=Invalid value around character 0.}
so my question is how can I bind a json object to GET URL??