JSON, AJAX, REST Terminology - json

Currently writing some documentation. Just wondering if we are using the terminology correctly.
We have an AJAX script that calls a service using a HTTP GET that returns JSON.
Would you call the service a REST service or a JSON service?

Using HTTP does not mean you're automatically following the REST architectural style. If you don't know what REST is, you're pretty much guaranteed to not be doing it. Call it "a web service that returns JSON" instead.

I'd call it a REST service which returns JSON.
EDIT
6 years on and what was I thinking! It's a web service which returns Json, as suggested in other answers. It may be RESTful, it may not.

A client calling a service using an HTTP GET would not constitute a RESTful architecture. The following elements should exist for a service that has a RESTful architecture.
HTTP - used as an application protocol, not a transport protocol
URI tunneling
Hypermedia
So, in your scenario, based on the given information, your service can be classified as a regular service with JSON hypermedia or content type. It is definetly not a REST architecture.
Here are some additional information:http://goo.gl/32gLK

Related

Find what parameters should I send for a POST request

I am trying to call a web service with a POST request, but I do not know the name of parameters that should be sent in the request. All I know is the address of the web service. Based on that, how can I find the parameters names?
Thank you for your advice,
Cheers.
For SOAP services you could get the interface from published WSDL. For HTTP based web services (REST), WADL was designed to describe the functionality, but it is not widely used, and it is not standarized by W3C.
Therefore, if you are not using SOAP, I suggest to look at documentation

What are data formatters and http protocols? When we should use them?

What are the data formatters and http protocols?
I am somewhat confused about the below terms:
1.ODATA
2.REST and SOAP
3.WCF services
4.XML web services
5. JSON
6. WSDL
REST - A style of web services.
JSON - JavaScript Object Notation - basically, a concise way of serializing objects.
SOAP - An XML format used to do web service calls
WCF Services - a Microsoft framework for making web services.
WSDL - Web Service Description Language. Usually used to automatically discover information about a web service, generate proxies, etc. - typically used with SOAP-based services.
OData - standard protocol/format for calling RESTful web services
The HTTP Protocol is at a somewhat lower level than these protocols are - it's a general application-level protocol that's used for making requests and responses in general. It's more about how you do a request to a server (and what it'll send back) in general, whereas things like OData and SOAP dictate what you actually put in the request and response. Does that make sense?

How can I discover what JSON endpoints a WCF service has?

How can I discover what JSON endpoints a WCF service has?
I know I can append wsdl to the URL and get the SOAP call details ...
http://myserver/Explore/TestService.svc?wsdl
but how can I get what JSON calls the service has?
You can't - there is no built-in mechanism for rest endpoint metadata - you just need to know which http options are applicable to which resources. You'll also need to have some types ready to deserialise to - if you can't get this information off the service provider then you'll need to infer them from the response json.
There is a service discovery standard called WADL which is supposed to do for http what wsdl does for SOAP. However unless the service provider has published one you're out of luck.

Is it possible to make Websocket as a REST instead of SOAP????

Is there any way to make a websocket as a REST service and host it in IIS..IIS8 only supports websocket with NetHttpBinding. and access from a client who has a proxy implemented for the service...But I want to have Websocket with REST..so that I can access that service from my android App and my HTML5 Client. Is that possible..???
I have a rest service in my project which serves data as per requirement.
1.RegisterTag(TagName);
2.value GetValue();
Now I have to have a callback from the service. First I have to call the RegisterTag(MyTagName). and then I should get notification from the server side.It is implemented with the Server sent events. But now I need to convert this REST service to websocket.
So, is it possible to add REST feature in WebSocket ?? I am planning to add NetHttpBinding in my new implementation.
Thanks
Arijit
have a look at this
Is ReST over websockets possible?
http://www.kimchy.org/rest_and_web_sockets/
REST does not require any specific protocol so it is possible to use websockets if you like.
"One thing that confuses people, is that REST and HTTP seem to be hand-in-hand. After all, the world-wide-web itself runs on HTTP, and it makes sense, a RESTful API does the same. However, there is nothing in the REST constraints that makes the usage of HTTP as a transfer protocol mandatory. It's perfectly possible to use other transfer protocols like SNMP, SMTP and others to use, and your API could still very well be a RESTful API"
http://restcookbook.com/Miscellaneous/rest-and-http/

Consume JSON in body of POST Request from ASP.NET

I need to be able to consume some JSON data in a POST request from another web app. I have tried looking at the various methods on the Request class, but nothing seems to give me the JSON I need.
Using Request.Form will not work, since it is not coming from a form, but another web app. The content type is application/json, and from examining the whole HTTP request, I know the JSON is in there. What is the best way to get at this JSON data?
Note: I am working from within an action on a controller.
I think you can get your JSON from your model parameter inside the Action of the Controller. Check out this article that explains a bit of what I mean.
You can also read this one for reference
Since you are consuming data from another web app I would use a REST web service instead of a controller in an MVC application. You cans use the ASP.NET Web API which makes it easy to setup a REST web API and it is tightly integrated in with MVC 4, which is now in Beta. If the communication is cross domain (i.e. different servers and/or ports) you will need to use JSONP. You can go to this StackOverflow QA for directions on how to use JSONP with Web API.