HttpRequest 클래스

HTTP 요청입니다.

클라이언트의 send_request 메서드에 전달되어야 합니다.


>>> from azure.core.rest import HttpRequest
>>> request = HttpRequest('GET', 'http://www.example.com')
<HttpRequest [GET], url: 'http://www.example.com'>
>>> response = client.send_request(request)
<HttpResponse: 200 OK>
상속
azure.core.rest._helpers.HttpRequestBackcompatMixin
HttpRequest

생성자

HttpRequest(method: str, url: str, *, params: Mapping[str, str | int | float | bool | None | Sequence[str | int | float | bool | None]] | None = None, headers: MutableMapping[str, str] | None = None, json: Any = None, content: str | bytes | Iterable[bytes] | AsyncIterable[bytes] | None = None, data: Dict[str, Any] | None = None, files: Mapping[str, str | bytes | IO[str] | IO[bytes] | Tuple[str | None, str | bytes | IO[str] | IO[bytes]] | Tuple[str | None, str | bytes | IO[str] | IO[bytes], str | None]] | Sequence[Tuple[str, str | bytes | IO[str] | IO[bytes] | Tuple[str | None, str | bytes | IO[str] | IO[bytes]] | Tuple[str | None, str | bytes | IO[str] | IO[bytes], str | None]]] | None = None, **kwargs: Any)

매개 변수

method
str
필수

HTTP 메서드(GET, HEAD 등)

url
str
필수

요청에 대한 URL입니다.

params
<xref:mapping>

URL에 매핑할 쿼리 매개 변수입니다. 입력은 쿼리 값에 대한 쿼리 이름의 매핑이어야 합니다.

headers
<xref:mapping>

요청에서 원하는 HTTP 헤더입니다. 입력은 헤더 값에 대한 헤더 이름의 매핑이어야 합니다.

json
any

JSON 직렬화 가능 개체입니다. 개체에 대한 JSON 직렬화를 처리하므로 데이터보다 더 복잡한 데이터 구조에 사용합니다.

content
str 또는 bytes 또는 <xref:iterable>[bytes] 또는 <xref:asynciterable>[bytes]

요청 본문에 원하는 콘텐츠입니다. 데이터가 json, 데이터 또는 파일에 맞지 않는 경우 입력해야 하는 kwarg로 간주합니다. 바이트 형식 또는 바이트를 생성하는 생성기를 허용합니다.

data
dict

요청 본문에 원하는 양식 데이터입니다. 양식으로 인코딩된 데이터(예: HTML 양식)에 사용합니다.

files
<xref:mapping>

요청 본문에 원하는 파일입니다. 다중 파트 인코딩을 사용하여 파일을 업로드하는 데 사용합니다. 입력은 파일 콘텐츠에 대한 파일 이름의 매핑이어야 합니다. 요청의 일부로 파일이 아닌 데이터 파일을 포함하려는 경우 데이터 kwarg도 사용합니다.

변수

url
str

이 요청이 반대되는 URL입니다.

method
str

이 요청의 메서드 형식입니다.

headers
<xref:mapping>

요청에 전달한 HTTP 헤더

content
any

요청에 대해 전달된 콘텐츠

특성

content

요청의 콘텐츠 가져오기

반환

요청의 콘텐츠

반환 형식

any