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
번호 분류 제목 날짜 조회 수
877 파이썬 파이썬 변수전달하기 2021.09.05 1446
876 Server XE성능 캐시활용으로 속도 100배 개선하기(Varnish 캐시서버 + XE(+패치) + nginx(혹은 아파치) / Wincache) file 2016.03.04 1448
875 컴퓨터잡담 파이썬 다음 증권의 주가 가져오기 2021.08.22 1452
874 컴퓨터잡담 파이썬 네이버 증권 주식 현재가 가져오기 2021.09.06 1463
873 컴퓨터잡담 파이썬 Beautifulsoup 웹크롤링 차단시 해결방법 2021.07.23 1473
872 WindowsTip Winpe 4in1 2015.03.10 1475
871 컴퓨터잡담 파이썬 네이버라인 메시지 보내기 2021.08.22 1480
870 컴퓨터잡담 파이썬으로 키움증권 open api 사용해보기 file 2021.08.24 1490
869 WindowsTip 알리익스프레스에서 산 ralink 802.n usb driver file 2015.01.09 1521
868 Server MySQL 5.6 my.cnf 글로벌 변수인지 세션변수인지 확인 2016.03.24 1527
867 컴퓨터잡담 파이썬 에러 해결방법 모음 2021.07.19 1537
866 WindowsTip 복구콘솔 USB 만들기 2015.01.09 1539
865 WindowsTip autohotkey regwrite ipv6 제거툴 file 2014.12.27 1540
864 컴퓨터잡담 무선 공유기 선택시 중요한 4가지 2015.09.07 1544
863 WindowsTip 윈도우 XP에서 exFAT 인식 패치방법 file 2015.01.14 1557
862 컴퓨터잡담 파이썬 pyautogui 명령어 2021.06.06 1559
861 컴퓨터잡담 파이썬 셀레니움으로 네이버 증권의 종목 검색하여 특정항목 클릭하기 2021.05.30 1564
860 컴퓨터잡담 [python] 윈도우 파이썬 모듈 설치 방법 (특정프로그램 설치 없이 기본프로그램 활용) 2021.09.02 1581
859 컴퓨터잡담 Python 파일을 exe파일로 컴파일하기 2021.06.16 1611
858 컴퓨터잡담 파이썬 멀티라벨 소스 줄이기 2021.06.23 1616
Board Pagination Prev 1 2 3 4 5 ... 46 Next
/ 46

http://urin79.com

우린친구블로그

sketchbook5, 스케치북5

sketchbook5, 스케치북5

나눔글꼴 설치 안내


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

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

설치 취소