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
번호 분류 제목 날짜 조회 수
737 Server 웹서버에서의 램디스크 엄청난 효과 비교하기 file 2016.11.27 4952
736 컴퓨터잡담 크롬 캐시파일 삭제방법(Chrome cache file delete) file 2016.11.27 2708
735 Server Minify로 CSS, JS파일, gzip으로 한꺼번에 압축해서 전송하기 file 2016.11.27 4337
734 Server 램드라이브를 이용한 mysql 번개속도로 개선방법 file 2016.11.27 5238
733 Server [mysql] Created tmp disk tables 디스크 쓰기방지 대안 1 2016.11.26 5159
732 Server 슈퍼캐시에서 .htaccess 이부분 제거해야 하나? 2016.11.23 4524
731 Server HP XW6600 E5430 SPEC file 2016.11.06 4731
730 Server XpressEngine 최적화 기진곰님의 슈퍼캐시 테스트 file 2016.09.19 5015
729 Server 윈도우용 MEMcached 설치방법 1 file 2016.09.17 5178
728 Excel 엑셀 암호변경 제거 방법 file 2016.09.12 6349
727 Server jQuery CDN 2016.09.11 4298
726 Server XE PC에서 모바일화면 출력방법 file 2016.09.08 2835
725 Server XE Request 줄이기 file 2016.09.07 1937
724 Server Apache에 대한 mod_proxy 지원 구성 2016.09.06 1801
723 WindowsTip vcruntime140.dll / vcomp140.dll / vcamp140.dll 오류해결법 2016.09.06 6840
722 WindowsTip Visual Studio 2015용 Visual C++ 재배포 설치 오류 해결방법 3 file 2016.09.06 15433
721 Server [php.ini]XE 신디케이션 OpenSSL 오류문구 해결방법 file 2016.08.25 2816
720 WindowsTip 윈도우 CPU 사용률 확인, 실시간 저장하기 2016.08.24 5685
719 Server innodb_use_sys_malloc to FALSE 2016.08.24 2637
718 Server innodb_use_sys_malloc에 따라 The InnoDB memory heap is disabled mysql error 메시지 1 2016.08.23 3794
Board Pagination Prev 1 ... 8 9 10 11 12 ... 46 Next
/ 46

http://urin79.com

우린친구블로그

sketchbook5, 스케치북5

sketchbook5, 스케치북5

나눔글꼴 설치 안내


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

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

설치 취소