This might be a very silly question, sorry for that but actually i do not understand the logic behind reading and writing the data to the URL. When someone post the data to the URL, where does that URL save that posted data, and when someone read data from URL, form where the data get fetched to the user through that URL. If someone need to read json data from a URL, but how this could be known that, someone has posted data onto this URL, and now i have to read that data. Could some one please explain this whole logic in context of REST, Thanks in advance
-
What you talking about? What data is fetched from the URL? URL stands for Uniform Resource Locator, it locates resources – Sleiman Jneidi Jul 11 '15 at 18:44
-
what kind of resources such as ? – Noorus Khan Jul 11 '15 at 18:48
-
https://en.wikipedia.org/wiki/Uniform_resource_locator – Sleiman Jneidi Jul 11 '15 at 18:49
-
Here it is saying simplest way to read json from a URL in java.. http://stackoverflow.com/questions/4308554/simplest-way-to-read-json-from-a-url-in-java... what does it mean actually .. – Noorus Khan Jul 11 '15 at 18:50
-
what i can understand is that, the data has been stored somewhere like some table in DB etc , and URL is the way that help to fetch the data, when someone hit that URL, behind the scene it happens that it makes a method call where some logic has been written to get the data from that table in DB, and that method that got invoked for that URL mapping, fetches that data and return some json or xml format data. IS it like that only or did i miss something – Noorus Khan Jul 11 '15 at 18:57
-
@Max you seem to have an understanding of what's going on behind the scenes. What is the source of your confusion? – Richard Barker Jul 11 '15 at 20:42
1 Answers
HTTP get requests typically put it's values on the URL and are called the query string. In HTTP post request the data is encoded and transmitted with the body of the request as form variables and therefore not typically included as a part of the URL. When a post or a get is sent, the server retrieves those variables and uses them however it needs to in order to process the request and generate a response. The URL specifically defines a resource. How the server handles the request for that resource is up to the server.
As far as RESTful services are concerned the process is still the same. The only difference is there isn't a Web page involved and all get/post requests are done programatically on the client side, or the side requesting the restful resource.

- 1,161
- 2
- 12
- 30