简体   繁体   English

为什么我的wcf服务请求标题总是得到

[英]Why my wcf service request headers always get

Work on wcf project,my service request headers why always become get ,even I request for post. 在wcf项目上工作,我的服务请求标题为什么总是得到,甚至我要求发布。

Bellow is my fiddler out put 贝娄是我的小提琴手

My post request 我的帖子请求

在此输入图像描述

result 302 responce 结果302响应

在此输入图像描述

result 405 responce 结果405回应

在此输入图像描述

What to do? 该怎么办? why my service behave strange way? 为什么我的服务行为奇怪?

This happens due to the redirection from the first url. 这是由于从第一个URL重定向而发生的。 Redirected requests are GET by nature and here the redirection is targeted to a url that accepts only POST. 重定向的请求本质上是GET,这里重定向的目标是只接受POST的URL。 In this case hitting the second url(the redirection target) using POST method solves the problem. 在这种情况下,使用POST方法命中第二个url(重定向目标)可以解决问题。

Now, as you say redirection is mandatory, one way to do that is to make the new URL allow GET and pass a encrypted token containing the useful parameters as a query string parameter. 现在,正如您所说的重定向是强制性的,一种方法是使新URL允许GET并将包含有用参数的加密令牌作为查询字符串参数传递。 This way you can get both: 1. encryption makes the second url secure and 2. you can pass the parameters to the new url without exposing them in the query-string. 通过这种方式,您可以同时获得:1。加密使第二个URL安全; 2.您可以将参数传递给新URL而不将它们暴露在查询字符串中。

Hope it helps. 希望能帮助到你。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 具有wsHttpBinding的WCF服务-处理HTTP请求标头 - WCF Service with wsHttpBinding - Manipulating HTTP request headers 在wcf服务中,请求中对象的值始终为null - The value of the object in the request always null in wcf service 我的Java代码始终返回错误请求400,当我将数据发布到WCF服务时 - My Java Code is always return Bad Request 400 When i am POSTing Data to a WCF Service 为什么我的WCF客户端/服务会收到ActionNotSupportedException? - Why do I get ActionNotSupportedException for my WCF client/service? 如何读取 WCF Web 服务中的 HTTP 请求标头? - How to read HTTP request headers in a WCF web service? 为什么我的C#客户端,POST到我的WCF REST服务,返回(400)错误请求? - Why does my C# client, POSTing to my WCF REST service, return (400) Bad Request? 为什么我的REST服务.NET客户端会发送没有身份验证标头的每个请求,然后使用身份验证标头重试它? - Why would my REST service .NET clients send every request without authentication headers and then retry it with authentication header? 从WCF Rest服务获取请求 - Get Request from WCF Rest service 在WCF REST服务中获取原始请求URL - Get original request url in WCF REST service 错误 400 on WCF Rest Service Get Request - Error 400 on WCF Rest Service Get Request
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM