0

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

woaksie
  • 89
  • 1
  • 3
  • 13
  • I think I answered this on the MSDN forum too, but I've sent JSON to the cloud (to an MVC app) before without trouble. I'd check that this code works when run locally on IIS. – user94559 Jan 21 '11 at 07:17
  • You would have to provide me with a bit more details. Does this work locally? Where are you posting to? What's the registration looking like? Which json codec are you using? Etc – SerialSeb Jan 21 '11 at 09:34

1 Answers1

0

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"

david
  • 33
  • 5
  • We ended up using Nancy instead of Open Rasta to do our REST API in the end for a bunch of reasons. It is all working fine now. – woaksie Jan 27 '11 at 17:54
  • @woaksie do you have more details about what got you to not use OpenRasta on your project? – SerialSeb Feb 07 '11 at 14:14