在Cake PHP中找到POST请求URL授权密钥

时间:2017-04-26 14:57:11

标签: ios cakephp swift3 alamofire

我正在使用Alamofire和CakePHP API来请求POST。在关注this documentation时会询问HTTP标头,但我不确定在我的网站目录中找到“授权”和“接受”键的位置。这会位于目录内还是其他地方?

这是我使用我的请求功能的地方:

func myImageUploadRequest() {

    Alamofire.request("http://178.62.107.243/posts", method: .post, parameters: parameters, encoding: JSONEncoding.default)

}

enum HTTPMethod: String {
        case post = "POST"
    }

let parameters: Parameters = [
    "id": post.id,
    "file_name": post.fileName,
    "artist_id": post.artistId
]

let headers: HTTPHeaders = [
        "Authorization": "",
        "Accept": ""
    ]

0 个答案:

没有答案