How to send json string to phil sturgeon's Rest Controller?

advertisements

This question may be stupid. I want to know if its possible to send a string like {"type":"kissme", "who":"john bennet"} to rest controller as a post request.

I know that post data has to be sent as somekey=somevalue&otherkey=othervalue as body of the request. While receiving we refer to the key to get the data. But how can we send any string without assigning to a key like json data ? If it is possible to send, how to receive ?

Thank you, Abbiya


REST implementation for CodeIgniter

You can use any of the following formats too simply by appending /format/json to the end of your URL or passing the correct MIME-type:

  1. xml
  2. json
  3. serialize
  4. php (raw output that can be used in eval)
  5. html
  6. csv

Source: http://philsturgeon.co.uk/blog/2009/06/REST-implementation-for-CodeIgniter