Answers for "x-www-form-urlencoded alamofire get"

0

swift alamofire x-www-form-urlencoded

let param:Parameters=[
        "param":param]
   let headers:HTTPHeaders=[
        "Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"]
    
    Alamofire.request(url,method: .post,parameters: param,encoding: URLEncoding.httpBody, headers: headers).responseJSON{response in
....
 }
Posted by: Guest on July-21-2021
0

swift alamofire x-www-form-urlencoded

let parameters: [String: [String]] = [
    "foo": ["bar"],
    "baz": ["a", "b"],
    "qux": ["x", "y", "z"]
]

// All three of these calls are equivalent
AF.request("https://httpbin.org/post", method: .post, parameters: parameters)
AF.request("https://httpbin.org/post", method: .post, parameters: parameters, encoder: URLEncodedFormParameterEncoder.default)
AF.request("https://httpbin.org/post", method: .post, parameters: parameters, encoder: URLEncodedFormParameterEncoder(destination: .httpBody))

// HTTP body: "qux[]=x&qux[]=y&qux[]=z&baz[]=a&baz[]=b&foo[]=bar"
Posted by: Guest on July-21-2021

Code answers related to "x-www-form-urlencoded alamofire get"

Code answers related to "Swift"

Browse Popular Code Answers by Language