REST - Http x Json

Asked

Viewed 476 times

4

I did some research and have some questions about REST:

  • Http is Rest?
  • JSON and XML are only the return format of a Rest operation?
  • REST x Web Services: are the same things?
  • SOAP would be the opposite of HTTP?

I appreciate anyone who can help me.

  • 2

    I think that question answers the first item: What is REST and Restful?

  • Very useful comment @rray.

  • But I was still in doubt, Http is Rest? And the other questions, someone?

  • 1

    That doesn’t hit the beam like the first => REST and HTTP are the same thing?

  • If I have a JSP file that returns a JSON, it is not necessarily a REST?

1 answer

9

TL;DR:

  • Not
  • Not
  • Not
  • Not

Version not so short:

  • Http is Rest?

HTTP is an application protocol that specifies hypertext traffic and behavior; REST is an architectural style whose focus is data elements. REST can be implemented over HTTP, but HTTP can be used to implement several other architectures - SOAP, for example.

  • JSON and XML are only the return format of a Rest operation?

While the vast majority of current REST implementations use JSON and XML as consumer data exchange formats, they are not only used in REST structures. Any process that requires data serialization (disk archiving or authentication, for example) can benefit from these two formats.

  • REST x Web Services: are the same things?

A Webservice can be implemented containing REST endpoints, but not exclusively. As mentioned above, SOAP endpoints (among others) are valid practices.

  • SOAP would be the opposite of HTTP?

No. Since SOAP is an XML-based format, the vast majority of implementations occur over HTTP.

  • If I have a JSP file that returns a JSON, it is not necessarily a REST?

  • 2

    @stringName a warning regarding editing: the items you removed in the edit are relevant, and may even change the author’s intention, so it was rejected. When editing, try to make edits that make the content clearer, without affecting the author’s intention in that answer/question.

  • 1

    @Luizach does not necessarily - a JSON result does not imply a REST API. Several Google Apis expose data in JSON, but do not represent a data object or implement REST. Example: http://maps.googleapis.com/maps/api/geocode/json?latg=40.714224,-73.961452&sensor=true

  • How can I call a JSP file that returns data via JSON?

  • 1

    @Luizach this will depend on the technologies that you are using in your solution, and perhaps run away a little from the topic of this question. If you wish, create a new question and show us how far you have come.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.