0

我整天都在用头撞这个。尝试从我的 web 应用程序发布到 stackexchange 时,我的请求不断收到 400 BAD REQUEST。我一直在使用提琴手来尝试欺骗请求,但我似乎无法让它通过。有谁知道原因是什么,以及我应该如何提出我的请求?

示例请求

OPTIONS https://api.stackexchange.com/2.2/questions/32262145/upvote?filter=default&key=9Gn[..the rest of key..]jMF*Q((&site=stackoverflow HTTP/1.1
Host: api.stackexchange.com
Connection: keep-alive
Access-Control-Request-Method: POST
Origin: [my site]
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.157 Safari/537.36
Access-Control-Request-Headers: accept, content-type
Accept: */*
Referer: [the page on my site]
Accept-Encoding: gzip, deflate, sdch
Accept-Language: en-US,en;q=0.8,nb;q=0.6

回复

HTTP/1.1 400 Bad Request
Cache-Control: private
Content-Type: application/json; charset=utf-8
Content-Encoding: gzip
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET, POST
Access-Control-Allow-Credentials: false
X-Content-Type-Options: nosniff
Date: Sat, 29 Aug 2015 

01:23:39 GMT
Content-Length: 95

使用 JSON

JSON
  error_id=404
  error_message=this method cannot be called this way
  error_name=no_method
4

0 回答 0