我从Curl发送一次相同的GET请求,另一次从Android应用程序发送,但服务器响应2个不同的答案。从curl响应是HTTP 200 ok,Android响应是401未经授权的访问。问题可能在身份验证令牌中。我使用Retrofit进行HttpConnection
卷曲请求:
HEADERS
Content-Type: application/json
Accept: application/json
User-Agent: curl/7.35.0
Host: requestb.in
Via: 1.1 vegur
Connection: close
Connect-Time: 2
Total-Route-Time: 1
X-Instructor-Token: VAmfAkkpLPq4PKeGhpaY
X-Instructor-Email: b@a.com
X-Request-Id: de7b9a62-abed-488d-afb5-414f9548ebc5
Android请求:
HEADERS
Content-Type:application/json
Accept-Encoding: gzip
Accept: applicationjson
User-Agent: Dalvik/1.6.0(Linux; U; Android 4.4.2; SM-N900 Build/KOT49H)
Host: requestb.in
Via: 1.1 vegur
Connection: close
Connect-Time: 11
Total-Route-Time: 19
X-Instructor-Token: VAmfAkkpLPq4PKeGhpaY
X-Instrutor-Email: b@a.com
X-Request-Id: 7b45ac68-54f8-49b3-baf4-bef41d661332