The $http.get and $http.post mentioned earlier are all based on $http shortcuts. The following is the complete $http:
$http (config)
$http accept a parameter config in JSON format:
The format of config is as follows:
{method: String, URL: String, Params:json object, data: Request data, headers: request header, Transformrequest: function, convert POST request format, Transformrespons E: function, convert the response to the format of the data, cache: Boolean, timeout: value, from the request start calculation, wait for the number of milliseconds, more than this number has not responded, then return error withcredentials: Boolean}
1.method: (Required)
Requested method, string format, ' post ', ' Get ', ' head ', ' delete ', ' put ', ' Jsonp '
(where the head method needs to ask the husband)
2.url: (Required)
Requested path, string format
3.params:
Request with parameters, JSON object:
{key1: ' value1 ', Key2: ' value2 '} // converted into URL? key1=value1&key2=value2
4.data:
The data, string, or JSON object submitted by the POST request
5.headers:
Request headers, JSON objects, parameters that can be customized to configure HTTP request headers
6.transformRequest:
function to convert the format of the POST request data
7.transformResponse:
function that transforms the format of the response to the data
8.cache:
Boolean value, whether to enable caching (temporarily do not understand, need to ask a husband)
9.timeout:
numeric value, the number of milliseconds to wait from the request, and an error is returned if the number is not responding.
10.withCredentials:
Don't understand