Search
 
SCRIPT & CODE EXAMPLE
 

SWIFT

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
....
 }
Comment

swift alamofire x-www-form-urlencoded

let headers = [
    "Content-Type": "application/x-www-form-urlencoded"
]
let parameters = [
    "myParameter": "value"
]
let url = NSURL(string: "https://something.com")!
Alamofire.request(.POST, url, parameters: parameters, headers: headers, encoding: .URLEncodedInURL).response { request, response, data, error in
    print(request)
    print(response)
    print(data)
    print(error)
}
Comment

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"
Comment

PREVIOUS NEXT
Code Example
Swift :: swiftui rectangle color 
Swift :: pop last element array swift 
Swift :: remove padding hstack swiftui 
Swift :: index string swift 
Swift :: swift setinterval 
Swift :: how to insert element at start of the array ios swift 
Swift :: Thread 1: breakpoint 1.1 
Swift :: listview swiftui 
Swift :: get address from latitude and longitude in swift 
Swift :: uiimage to data swift 
Swift :: how to change the color of back button navbar xcodee 
Swift :: swift get "system" asset image 
Swift :: swiftui actionsheet 
Swift :: transform string to url swift 
Swift :: swiftui popover 
Swift :: objective c vs swift 
Swift :: how to get the path of selected PDF/doc from file manager in ios swift programmatically 
Swift :: Swift Trailing Closure 
Swift :: and or in swift 
Swift :: swift guard statement 
Swift :: swift initialize array with size 
Swift :: Swift Right Shift Operator 
Swift :: does swift language requires mac os system 
Swift :: swift do catch where 
Swift :: how to darken view swiftui 
Swift :: access tuple elements 
Swift :: how to check if not running in debufgger swift 
Swift :: how to use IBOutlet variables as static in swift 
Swift :: swift isMemberOf 
Swift :: Swift Code Blocks 
ADD CONTENT
Topic
Content
Source link
Name
7+6 =