Difference between $http.get , $http.post ,$http.put , $http.delete $http.head and $http.jsonp

11,019

An HTTP GET request is what you get (pardon the pun) when you enter a URI in your browser or when you click on a link on a web page. Certain HTML elements, like also generate GET requests. GET requests a resource (usually a web page or an image) from the server. You can pass additional information to a server-side script by adding 'query parameters' after the script, such as example.com?foo&bar=42.

A POST request is similar to a GET request. The difference is that any additional information is sent in the body of the request, rather than as part of the URI. You can generate POST requests using elements in HTML, where the form field values are sent in the request body.

A HEAD request is also similar to a GET request, but the server responds only with the HTTP headers; the response body is empty.

A PUT request is a way to upload a file to a server. Most servers don't allow PUT requests, because of the security implications.

Similarly, a DELETE request will delete a resource on the server. Like PUT, this method is rarely permitted on server for obvious reasons.

source: http://www.sitepoint.com/forums/showthread.php?526956-what-are-GET-POST-PUT-and-DELETE-HTTP-request-and-how-to-use-them

For jsonp I would say to take a look at wikipedia explanation. But it's basically a technique that allows you to make cross-domain requests via XMLHttpRequest.

Share:
11,019
Saurabh Mahajan
Author by

Saurabh Mahajan

Updated on July 20, 2022

Comments

  • Saurabh Mahajan
    Saurabh Mahajan almost 2 years

    I am new to angular js and web development. Please help me.

    Today i read about $http in angular js but i am only aware about the get and post methods .

    Can Please anyone explain ,me what is the Difference between $http.get , $http.post ,$http.put , $http.delete $http.head and $http.jsonp

    all of them and when to use.

    Thanks in advance.