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

Python Requests post() Method

조회 수 1343 추천 수 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
 
로그인 후 댓글쓰기가 가능합니다.

?

List of Articles
번호 분류 제목 날짜 조회 수
77 WindowsTip 윈도우 빠른종료 팁 file 2014.12.27 1821
76 Server xe 타이틀 게시판 이름 없애기 file 2016.06.28 1803
75 Server Apache에 대한 mod_proxy 지원 구성 2016.09.06 1801
74 컴퓨터잡담 파이썬 사이트 정보 가져와서 필요한 내용 추출하기 2021.05.31 1779
73 WindowsTip 컴퓨터가 많이 느리다면? 2015.01.08 1777
72 WindowsTip 윈도우 XP SP3 와 Windows 8.1 두가지 부팅 메뉴얼 file 2015.02.11 1768
71 컴퓨터잡담 KM Wakeup 절전모드 예약 및 깨우는 프로그램 file 2021.07.08 1763
70 파이썬 키움증권 OpenAPI 당황스러움 file 2021.09.06 1749
69 Server 서버 부하상태 체크 file 2016.04.30 1709
68 컴퓨터잡담 파이썬 리스트에 데이터 삽입하기 2021.06.22 1707
67 [Docs]스프레드시트 스프레드시트의 값의 변화에 따라 지메일로 메일을 보내는 스크립트 2023.03.10 1661
66 WindowsTip 익스플로러 ftp 정상화 시키기 file 2014.12.23 1660
65 Server [Apache] mod_expires .htaccess을 수정하여 브라우저 캐싱하기 2016.03.16 1657
64 Server XE file cache 활용 2016.08.19 1648
63 WindowsTip IE 익스플로러 메뉴 바탕이 검정색으로 변했을경우 대처방법 2 2015.01.27 1644
62 Server [아파치 error.log] Fatal Error Unable to reattach to base address file 2016.03.25 1643
61 컴퓨터잡담 파이썬 한우정액 정보 스프레드로 추출하기 file 2021.06.05 1625
60 컴퓨터잡담 파이썬 멀티라벨 소스 줄이기 2021.06.23 1616
59 컴퓨터잡담 Python 파일을 exe파일로 컴파일하기 2021.06.16 1611
58 컴퓨터잡담 [python] 윈도우 파이썬 모듈 설치 방법 (특정프로그램 설치 없이 기본프로그램 활용) 2021.09.02 1581
Board Pagination Prev 1 ... 41 42 43 44 45 46 Next
/ 46

http://urin79.com

우린친구블로그

sketchbook5, 스케치북5

sketchbook5, 스케치북5

나눔글꼴 설치 안내


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

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

설치 취소