Ajax call,REST/SOAP,Htttp explanations required

I am unable to get the clear difference between these( Ajax call,REST/SOAP,Htttp) terms as they somehow confuses me. WHat I know about them right now is:

Ajax call: It’s used to send the request and receive the response back from the Server.
We use the method $.ajax() and we give the config for this like url, arguments, header etc. inside ajax() method and expect a response in return from backend written in PHP or any other language.

**REST/SOAP:**These both are different ways to communicate with the server. Parameters send in REST protocol are appended in its url while in SOAP parameters are encrypted while sending the request.REST is easy to implement and SOAP is little bit tedious to implement.SOAP is used for the secure connections while REST can be used for connections which doesn’t needs security.I am unaware how to implement it ?

**HTTP:**I have seen this term in no. of coding snippets but how it is used, I am unaware of it. All I know about it is “It is the protocol to interact with the server for the data transmission over the network”. But how does it work, No idea!

Along with this, How all these concepts are connected to each other Is there any single example which uses all these concept together. Till now I have used the ajax call in jquery which sends the request to the PHP page which in return sends the response in HTML form and we parse that data to get the relevance portion.

Any detail explanation will be helpful. Thanks in Advance !

HTTP is the protocol. That means it is just a list of commands. Browsers and web servers use these commands to talk with each other. When you put an URL into address bar of your browser it connects to the server and asks “give me that page plz”. Server responds either “Ok, take it” or something like “Page not found”. Here is how this talk will look if we translate it into HTTP set of commands:

Browser: GET /path/to/file/index.html HTTP/1.0
Server: HTTP/1.0 200 OK (then page source code goes here)

AJAX is a technique which allows your browser to get part of the page, instead of whole page. Of course, your browser still use HTTP to ask server for that data.

REST is an interface (API) that web service provides for its users. It’s mainly used to provide a way to fetch raw data. For example, imagine that you want to get coordinates of the city. You go to the Google Maps website with your browser, search that city and see the coordinates. But what if you need to do that for 4000 cities? Fortunately, Google Maps website has a REST service (aka Google Maps API) that allows you to fetch all required data (coordinates) from single URL. That URL doesn’t return anything except the data (no HTML/CSS markup). And, of course, to ask for that data and to get it you still use HTTP.

Hope that helps. Sorry for my grammar :smiley:

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.