If i implement a REST based WCF service, then as a Request i will just use my http url say fr example http://www.example.com/createuser/user1
Now, the data i need to post to the server would go as part of HttpRequest object itslef, is this correct if i am using post method?
Also as part of response what do i get, do i get just JSON which is what i want from response or an HttpResponse object, which has json as part of it’s body?
First of all, your URL still seems as RPC style. The method name smells in the URL(createruser/user1).
Instead if your user as resource, then the collection of Users could be shown as following
http://www.example.com/users (with HTTP get) which would give you all the users.
For a perticular user
http://www.example.com/Users/User_Id with HTTP get Method
If you want to create a perticular user, then
http://www.example.com/Users with HTTP Post.
Now, HTTP Post sends data in form collection, so the information to create a user would be sent as form data.
As for respone, the server can send you multiple form of respone. The client has to tell in accept headers what kind of Representation he would like for a perticular resource(it could be sepcified in url also like the twitter apis). The server, then can take the client request in consideration and server the response in the content type. There are other media types also other than JSON, XML and plain text
As for your HTTResponse object, it would depend what kind of technology you are using to make a requeset. If you are using C#, then you would get a HTTPResponse object. If Javascript then you would get response, embedded inside XMLHttpRequest body(either by responseXML or responseText)
EDIT
You could use Rest StarterKit for WCF or even you could use WebAPI.
In WCF, while declaring your operation contract, you would annotate your method with following attributes
What does it tells
Method = “GET” http method used for this resource
UriTemplate = for mapping the method to URL. A perticular URL needs a perticular method to be invoked.
ResponseFormat = Server to return the response in this format.
You could find more details over here and here