HTTP GET Request
Request web resources with HTTP GET method
GET request is the most common and widely used method in APIs and websites. HTTP GET method is used to retrieve data
from a server at the specified resource. For example, making a GET request to API users’ endpoint should return a list
of all available users.
HTTP GET is only requesting data and not modifying any resources, which is why it is considered safe and idempotent. Safe means that it should not change the state of the server. And idempotent means that the method can be called many times without different outcomes.
The HTTP GET semantics changes to conditional if HTTP GET includes conditional headers. The conditional HTTP GET means that HTTP GET entities should be transmitted only under the circumstances provided in the conditional headers. Conditional HTTP GET is supposed to reduce the redundant use of Internet traffic.
HTTP GET obtains any information identified by the request-URI.
HTTP GET syntax is following
There are a few comments on GET requests:
- GET requests should not be used when dealing with sensitive data as data is visible to everyone in the URL.
- When sending data, the GET method adds the data to the URL; and the length of a URL is limited - maximum 2048 characters.
- Only ASCII characters are allowed when using GET.
- GET requests can be cached and bookmarked.
- GET parameters to remain in browser history.
And there is a precaution:
If a seemingly safe method like GET changes a resource, it might be possible that any middleware client proxy systems between you and the server will cache this response. This never happens with non-safe and non-idempotent methods.
Copyright Notice: Please don't copy or translate this article without prior written permission from the HTTPDebugger.com
HTTP GET is only requesting data and not modifying any resources, which is why it is considered safe and idempotent. Safe means that it should not change the state of the server. And idempotent means that the method can be called many times without different outcomes.
The HTTP GET semantics changes to conditional if HTTP GET includes conditional headers. The conditional HTTP GET means that HTTP GET entities should be transmitted only under the circumstances provided in the conditional headers. Conditional HTTP GET is supposed to reduce the redundant use of Internet traffic.
HTTP GET obtains any information identified by the request-URI.
HTTP GET syntax is following
get(url: string, options: { headers: HttpHeaders; observe: 'response'; params: HttpParams; reportProgress: boolean; responseType: 'json'; withCredentials: boolean; }): Observable<HttpResponse<Object>>;
There are a few comments on GET requests:
- GET requests should not be used when dealing with sensitive data as data is visible to everyone in the URL.
- When sending data, the GET method adds the data to the URL; and the length of a URL is limited - maximum 2048 characters.
- Only ASCII characters are allowed when using GET.
- GET requests can be cached and bookmarked.
- GET parameters to remain in browser history.
And there is a precaution:
If a seemingly safe method like GET changes a resource, it might be possible that any middleware client proxy systems between you and the server will cache this response. This never happens with non-safe and non-idempotent methods.
Copyright Notice: Please don't copy or translate this article without prior written permission from the HTTPDebugger.com
HTTP Debugger is a proxy-less HTTP analyzer for developers that provides the ability to capture and analyze HTTP headers,
cookies, POST params, HTTP content and CORS headers from any browser or desktop application.
Awesome UI and very easy to use. Not a proxy, no network issues!
Download FREE 7-Day Trial