tags:

views:

62

answers:

1

Hi,

I am writing a thesis and currently desccribing the implemented methods and services. In the book RESTful Web Services (O'Reilly) I noticed there are the following possible request formats: JSON, XML, made-up vocabulary and Atom.

I created a service using WCF. Below is one of the methods declared in the interface:

    [OperationContract]
    [WebGet(ResponseFormat = WebMessageFormat.Json,
        UriTemplate = "/{strSessionString}/time={time}&lat={latitude}&long={longitude}")]
    Response StoreLocation(string strSessionString, string time, string latitude, string longitude);

The client side is an Android application which simply composes strings appropriate for UriTemplate and makes HTTP GET requests to the address (composed string).

The solution works fine but now have to explain what is the request format. I would appreciate if anyone could provide any useful resource describing the topic. Unfortunately during the weekend I don't have access to the library so it would be more useful to have resources from the web.

A: 

You might call the "request format" for your example a "query string".

Request formats are really only applicable to HTTP PUT and POST methods, which can contain an arbitrary payload of data formatted in some way as part of the request body. Since a GET request does not have a body, you don't have the opportunity to format anything.

Also, I think the only restriction there is on request formats for RESTful web services is that they have a mime-type. JSON and XML are just the most common formats. You could just as well implement a RESTful web service using google protocol buffers.

pcardune