简体   繁体   中英

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.

Bellow is my fiddler out put

My post request

在此输入图像描述

result 302 responce

在此输入图像描述

result 405 responce

在此输入图像描述

What to do? why my service behave strange way?

This happens due to the redirection from the first url. Redirected requests are GET by nature and here the redirection is targeted to a url that accepts only POST. In this case hitting the second url(the redirection target) using POST method solves the problem.

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. 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.

Hope it helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM