Skip to content
컴퓨터잡담
2021.08.31 08:09

Python Requests post() Method

조회 수 1325 추천 수 0 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄

Python Requests post() Method

 

https://www.w3schools.com/python/ref_requests_post.asp

Python Requests post() Method

❮ Requests Module


Example

Make a POST request to a web page, and return the response text:

import requests

url = 'https://www.w3schools.com/python/demopage.php'
myobj = {'somekey''somevalue'}

x = requests.post(url, data = myobj)

print(x.text)
Run Example »

Definition and Usage

The post() method sends a POST request to the specified url.

The post() method is used when you want to send some data to the server.


Syntax

requests.post(url, data={keyvalue}, json={keyvalue}, args)

args means zero or more of the named arguments in the parameter table below. Example:

requests.post(url, data = myobj, timeout=2.50)

Parameter Values

Parameter   Description
url Try it Required. The url of the request
data Try it Optional. A dictionary, list of tuples, bytes or a file object to send to the specified url
json Try it Optional. A JSON object to send to the specified url
files Try it Optional. A dictionary of files to send to the specified url
allow_redirects Try it Optional. A Boolean to enable/disable redirection.
Default True (allowing redirects)
auth Try it Optional. A tuple to enable a certain HTTP authentication.
Default None
cert Try it Optional. A String or Tuple specifying a cert file or key.
Default None
cookies Try it Optional. A dictionary of cookies to send to the specified url.
Default None
headers Try it Optional. A dictionary of HTTP headers to send to the specified url.
Default None
proxies Try it Optional. A dictionary of the protocol to the proxy url.
Default None
stream Try it Optional. A Boolean indication if the response should be immediately downloaded (False) or streamed (True).
Default False
timeout Try it Optional. A number, or a tuple, indicating how many seconds to wait for the client to make a connection and/or send a response.
Default None which means the request will continue until the connection is closed
verify Try it
Try it
Optional. A Boolean or a String indication to verify the servers TLS certificate or not.
Default True
 
로그인 후 댓글쓰기가 가능합니다.

?

  1. 윈도우 10 절전모드(슬립모드) 예약해제 방법

  2. No Image 05Mar
    by Progress
    2016/03/05 in Server
    Views 525 

    PHP 가속기

  3. 서버 다운 원인

  4. No Image 30Nov
    by nanumi
    2016/11/30 in Server
    Views 585 

    Server 성능 테스트

  5. ACTIVE-X 의 무서움

  6. Sitemap.xml 만들어 주는 사이트

  7. 크롬 속도올리기

  8. 박지성 맨유시절 호날두와의 호흡경기 모음(유니세프 친선경기)

  9. 도스 배치파일로 원격지 컴퓨터 모니터링

  10. 파이썬(python) 자주 사용하는 명령 모으기

  11. python 문자열에서 모든 공백을 제거

  12. 아나콘다에서 모듈을 설치할 때에는?

  13. 파이썬 키움증권 open api 스크랩

  14. PC에 안드로이드 설치하기

  15. 핑테스트 프로그램

  16. 타지역 농지매입

  17. No Image 03Mar
    by Progress
    2015/03/03 in Server
    Views 1133 

    php.ini 파일설정으로 파일업로드 용량늘리기

  18. 파이썬 변수값에서 숫자만 추출하기

  19. [안드로이드] 키캣 4.4 버전 플래시 동영상 안될때 해결방법

  20. No Image 13Jul
    by Progress
    2015/07/13 in Server
    Views 1151 

    XE ckeditor 모바일에서 사용하기

Board Pagination Prev 1 2 3 4 5 ... 46 Next
/ 46

http://urin79.com

우린친구블로그

sketchbook5, 스케치북5

sketchbook5, 스케치북5

나눔글꼴 설치 안내


이 PC에는 나눔글꼴이 설치되어 있지 않습니다.

이 사이트를 나눔글꼴로 보기 위해서는
나눔글꼴을 설치해야 합니다.

설치 취소