| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | 5 | 6 | 7 |
| 8 | 9 | 10 | 11 | 12 | 13 | 14 |
| 15 | 16 | 17 | 18 | 19 | 20 | 21 |
| 22 | 23 | 24 | 25 | 26 | 27 | 28 |
| 29 | 30 | 31 |
Tags
- 뉴스
- 코테
- MySQL
- 알고리즘
- 20201017뉴스
- 헤드라인모음
- 경제뉴스
- 20201018뉴스
- 크롤링
- 기사헤드라인
- 20201016뉴스
- encoding
- C++
- 20200615뉴스
- 20200816뉴스
- 20201011뉴스
- 헤드라인뉴스
- 20201013뉴스
- 파이썬
- 뉴스헤드라인
- 헤드라인기사
- 오늘의뉴스
- 20201015뉴스
- json
- 백준2225
- LeetCode #Python #알고리즘 #코딩테스트 #interview
- 기사
- 백준
- Python
- 헤드라인
Archives
- Today
- Total
HelloCho
[Python] http post 방식으로 json Data Parameter 보내기 본문
http post 방식으로 사용하는 예제입니다.
요청 파라미터는 json을 사용하였습니다.
아래는 예시입니다.
import json
from json.decoder import JSONDecoder
from os import error
import requests
def Send():
headers = {}
headers = { 'content-type': 'application/json' }
postData = """[ "variables": {"id": "12345", "input": {"Id": "111", "type": "test", "item": "0", "Id2": "null", "page": "1", "display":10, "info": true }}}]"""
response = requests.post("https://test.com", headers=headers, data=postData)
return response.text
'Python' 카테고리의 다른 글
| [Python] pandas unicodeEncodeError 'cp949' (0) | 2021.05.31 |
|---|---|
| [Python] Mac OS pip 설치하기 (0) | 2021.04.28 |
| [Python] WebDriverException: Message: unknown error: cannot find Chrome binary 에러 해결하기 (1) | 2020.12.28 |
Comments