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

Python Requests post() Method

조회 수 1270 추천 수 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
번호 분류 제목 날짜 조회 수
2294 주식 2015-7-16 오늘 대박 file 2015.07.16 658
2293 주식 2015-7-20 허탈한 하루 file 2015.07.20 658
2292 유용한상식 Mini Capacitor Spot welder x 10 units 2015.01.30 664
2291 연예정보 강소라 동네변호사 조들호로 기대주 file 2016.03.23 664
2290 컴퓨터잡담 ACTIVE-X 의 무서움 file 2015.12.26 666
2289 중학1) 일차방정식-중단원 2021.08.13 667
2288 유용한상식 전국 동물원 2015.03.20 669
2287 중1) 최대공약수와 최소공배수 2021.08.12 674
2286 연예정보 이세돌 상대 알파고 타이젬에서 9단? 2016.03.09 675
2285 유용한상식 필러정보 2015.01.23 676
Board Pagination Prev 1 ... 4 5 6 7 8 ... 235 Next
/ 235

http://urin79.com

우린친구블로그

sketchbook5, 스케치북5

sketchbook5, 스케치북5

나눔글꼴 설치 안내


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

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

설치 취소