Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. HTTP
  3. Reference
  4. Request methods
  5. GET

GET request method

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since ⁨July 2015⁩.

TheGET HTTP method requests a representation of the specified resource.Requests usingGET should only be used to request data and shouldn't contain a body.

Note:The semantics of sending a message body inGET requests are undefined.Some servers may reject the request with a4XX client error response.

Request has bodyNo
Successful response has bodyYes
SafeYes
IdempotentYes
CacheableYes
Allowed in HTML formsYes

Syntax

http
GET <request-target>["?"<query>] HTTP/1.1
<request-target>

Identifies the target resource of the request when combined with the information provided in theHost header.This is an absolute path (e.g.,/path/to/file.html) in requests to an origin server, and an absolute URL in requests to proxies (e.g.,http://www.example.com/path/to/file.html).

<query>Optional

An optional query component preceded by a question-mark?.Often used to carry identifying information in the form ofkey=value pairs.

Examples

Successfully retrieving a resource

The followingGET request asks for the resource atexample.com/contact:

http
GET /contact HTTP/1.1Host: example.comUser-Agent: curl/8.6.0Accept: */*

The server sends back the resource with a200 OK status code, indicating success:

http
HTTP/1.1 200 OKContent-Type: text/html; charset=UTF-8Date: Fri, 21 Jun 2024 14:18:33 GMTLast-Modified: Thu, 17 Oct 2019 07:18:26 GMTContent-Length: 1234<!doctype html><!-- HTML content follows -->

Specifications

Specification
HTTP Semantics
# GET

Browser compatibility

See also

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp