开发者

Azure REST API on a web role does not accept POST with Json body

开发者 https://www.devze.com 2023-02-05 16:06 出处:网络
We are using Open Rasta on an Azure Web Role to provide a REST API. Our GET methods work fine returning Json data. When I try and POST a request with a 开发者_如何学JAVAJson body I get this error.

We are using Open Rasta on an Azure Web Role to provide a REST API. Our GET methods work fine returning Json data. When I try and POST a request with a 开发者_如何学JAVAJson body I get this error.

The server cannot service the request because the media type is unsupported. It returns a 415 code. I examined the messages in Fiddler and they look ok.

I am guessing that IIS is not setup to allow -> Content-Type: application/json

I found this http://msdn.microsoft.com/en-us/library/gg433059.aspx but am not sure what I need to do to get this to work.

Any help would be great.


I dont recall the answer exactly, but in Non Azure types of situations at least there is a web.config file that you set to allow Posts.

I believe it's this:
system.web protocols add name = "HttpPost"

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号