从 AFNetworking (iOS) 获取 PATCH 请求 404,但从浏览器获取 200

Getting 404 on PATCH Request from AFNetworking (iOS) but 200 from Browser

我正在尝试向服务器发出 PATCH 请求,但我的请愿书总是收到 404,但在浏览器中却收到 200。 据我所知,使用 AFNetworking 的 PATCH 请求没有将我的参数附加到 URL,这导致了错误。知道为什么吗?有什么我想念的吗? 这是我正在做的请愿书:

let params = ["token": token, "id": id]  
let requestSerializer = AFJSONRequestSerializer()
let responseSerializer = AFJSONResponseSerializer(readingOptions:
                NSJSONReadingOptions.AllowFragments)
let baseURL = NSURL(string: GlobalConstants.WebServiceURL.base)
let httpRequestOperationManager = AFHTTPRequestOperationManager(baseURL: baseURL)

requestSerializer.setValue("application/json", forHTTPHeaderField: "Content-Type")

requestSerializer.timeoutInterval = NSTimeInterval(GlobalConstants.httpRequestTimeout)

httpRequestOperationManager!.requestSerializer = requestSerializer
httpRequestOperationManager!.responseSerializer = responseSerializer

httpRequestOperationManager.PATCH(url,
                                parameters: params,
                                success: { (operation: AFHTTPRequestOperation!, responseObject: AnyObject!) in

                                    onSuccess()

                                }, failure: { (operation: AFHTTPRequestOperation!, error: NSError!) in

                                    onFailure(error)

                            })

改为:

httpRequestOperationManager.PATCH(...)

尝试使用:

httpRequestOperationManager.GET(...)