我尝试将自定义标头发送到后端,如下所示:
RequestBuilder builder = new RequestBuilder(RequestBuilder.POST, url);
builder.setHeader("X-SessionID", "ABC123456");
并将通过以下方式接收:
public object AfterReceiveRequest(ref Message request, IClientChannel channel, InstanceContext instanceContext)
{
}
但是'Message'对象是空的!我错了什么?
谢谢!
答案 0 :(得分:1)
这是CORS错误!我禁用了te OPTION方法!所以他不能正确发送它!
启用OPTION方法,一切正常!