服务器看不到Retrofit发送的HTTP标头
我正在使用Raturofit,通过3个标头向服务器提出请求, 但是以错误接收响应代码“ 500”:
未定义的索引:AppCode /home/c/cb37912/url.com/public_html/roid/core/baseroid.php 110 无法修改标头信息 - 已经发送的标题(输出启动,请访问/home/c/cb37912/url.com/public_html/index.php:15)
我认为服务器根本看不到“ AppCode”标头,尽管我可以从记录拦截器和网络拦截器是“ AppCode”标头发送的。邮递员一切都起作用。我试图使标头动态,静态,并将其添加到Okhttp拦截器中。 “ AppCode”是该服务器看不到的唯一标题。
这是我的获取请求:
@Headers({"Content-Type: application/json",
"timestamp: 1644455642",
"appCode: a3b5a686a638c08d2880868501ee9c1f"
})
@GET("v1/categories")
Call<ResponseBody> getCategories();
这是网络截距的屏幕截图:
任何提示都将不胜感激。谢谢
I am making GET request to server with 3 headers using Retrofit,
but receiving response code "500" with error:
Undefined index: appCode
/home/c/cb37912/url.com/public_html/roid/core/BaseRoid.php
110
Cannot modify header information - headers already sent by (output started at /home/c/cb37912/url.com/public_html/index.php: 15)
I think Server does not see "appCode" HEADER at all, although I can see from logging Interceptor and Network Interceptor being "appCode" HEADER sent. It Postman everything works. I have tried to make headers dynamic, static and also add them to okhttp interceptor. "appCode" is the only header , that server does not see.
Here's my GET request:
@Headers({"Content-Type: application/json",
"timestamp: 1644455642",
"appCode: a3b5a686a638c08d2880868501ee9c1f"
})
@GET("v1/categories")
Call<ResponseBody> getCategories();
Here's the screenshot of Network Interceptor:
As you can see from picture appCode Header is sent.
Any tip will be appreciated.Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论