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
번호 분류 제목 날짜 조회 수
837 파이썬 파이썬 매수할 피라미드 매수전략 2021.09.06 1853
836 파이썬 키움증권 OpenAPI 당황스러움 file 2021.09.06 1749
835 파이썬 파이썬 키움증권 OPEN API 매수/매도/정정/취소 주문방법 2021.09.05 4036
834 파이썬 파이썬 변수전달하기 2021.09.05 1446
833 컴퓨터잡담 파이썬 키움증권 open api 분할매매 수식구하기 2021.09.04 1343
832 컴퓨터잡담 파이썬(python) 자주 사용하는 명령 모으기 2021.09.03 884
831 컴퓨터잡담 [python] 윈도우 파이썬 모듈 설치 방법 (특정프로그램 설치 없이 기본프로그램 활용) 2021.09.02 1581
830 컴퓨터잡담 아나콘다에서 모듈을 설치할 때에는? 2021.09.02 941
829 컴퓨터잡담 파이썬 키움증권 open api 스크랩 2021.09.02 969
828 컴퓨터잡담 python 문자열에서 모든 공백을 제거 2021.08.31 897
» 컴퓨터잡담 Python Requests post() Method 2021.08.31 1343
826 컴퓨터잡담 파이썬 JSON으로 받아온 데이터의 Key 값 가져오기 2021.08.27 10838
825 컴퓨터잡담 파이썬으로 키움증권 open api 사용해보기 file 2021.08.24 1490
824 컴퓨터잡담 파이썬 다음 증권의 주가 가져오기 2021.08.22 1452
823 컴퓨터잡담 파이썬 네이버라인 메시지 보내기 2021.08.22 1479
822 컴퓨터잡담 파이썬 파일로 읽어올 때 \n이 \\n으로 변경되는 현상 대처방법 2021.08.15 1341
821 컴퓨터잡담 python pip 에러 line 193, line 197 해결방법 2021.08.12 4061
820 컴퓨터잡담 카카오 인증관련 오류 file 2021.08.08 7952
819 HTMLPHPMSQL CCS 메뉴 스타일 링크 2021.08.04 3891
818 컴퓨터잡담 파이썬 FTP 업로드/다운로드 하기 2021.07.31 3393
Board Pagination Prev 1 ... 3 4 5 6 7 ... 46 Next
/ 46

http://urin79.com

우린친구블로그

sketchbook5, 스케치북5

sketchbook5, 스케치북5

나눔글꼴 설치 안내


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

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

설치 취소