Alamofire Accept and Content-Type JSON

后端 未结 5 1092
心在旅途
心在旅途 2020-12-29 09:48

I\'m trying to make a GET request with Alamofire in Swift. I need to set the following headers:

Content-Type: application/json
Accept: application/json
         


        
5条回答
  •  长情又很酷
    2020-12-29 09:57

    Alamofire.request(url, method: .post, parameters:parameters, encoding: JSONEncoding.default).responseJSON { response in
         ...      
    }
    

    it's work

提交回复
热议问题