我在Retrofit2中有一个POST请求,不幸的是响应为403。 我请服务器端人员查看他们的日志,他们告诉我我没有发送POST请求,而是发送了HEAD请求,因此IIS不响应我的实际请求(他们不接受HEAD请求) 。 我需要知道如何禁用此“预请求”到服务器。 下面是我的改造日志:
Network: --> POST https://uat.onepay.com.my:65002/TADWeb2/pos/
Network: Content-Type: application/json; charset=UTF-8
Network: Content-Length: 152
Network: Accept: application/json
Network: User-Agent: POS
Network: {"d":"knJTBOx9aldlnWJYiw1LxSVBD47sga+F8a1hUCg3kNs=","t":"2019-04-08 13:46:44","h":"h7kLsZ0X1mCZtdN1zYcGvByxQO2hcfHGd1+ua8QDhFk=","m":"fc:ee:e6:5:60:be"}
Network: --> END POST (152-byte body)
Network: <-- 403 Forbidden https://uat.onepay.com.my:65002/TADWeb2/pos/ (269ms)
Network: Content-Type: text/html
Network: Server: Microsoft-IIS/8.0
Network: X-Powered-By: ASP.NET
Network: Date: Mon, 08 Apr 2019 05:46:42 GMT
Network: Content-Length: 1233
Network: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
注意:此api适用于邮递员