Notice
														
												
											
												
												
													Recent Posts
													
											
												
												
													Recent Comments
													
											
												
												
													Link
													
											
									| 일 | 월 | 화 | 수 | 목 | 금 | 토 | 
|---|---|---|---|---|---|---|
| 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
													
											
												
												- mssql
- 함수
- port
- node.js
- urllib
- Excel
- ubuntu
- ASP
- PyQt5
- 라즈베리파이
- IOS
- 날짜
- PER
- Linux
- javascript
- 다이어트
- PyQt
- MS-SQL
- tensorflow
- flutter
- pandas
- 유니티
- python
- swift
- sqlite
- GIT
- MySQL
- 리눅스
- Unity
- 맛집
													Archives
													
											
											
											
											아미(아름다운미소)
Python3 urllib으로 http로 POST 전송 본문
Python3 urllib으로 http로 POST 전송
'''
Created on 2019. 12. 21.
@author: test
'''
import urllib.parse
import urllib.request
details = urllib.parse.urlencode({'CODE': '코드', 'NAME': '이름', 'KIND': '종류', 'PRICE': '가격', 'USERID': '아이디'})
details = details.encode('UTF-8')
url = urllib.request.Request('https://test.cafe24.com/postdata_test.php', details)
url.add_header("User-Agent","Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/525.13 (KHTML, like Gecko) Chrome/0.2.149.29 Safari/525.13")
ResponseData = urllib.request.urlopen(url).read().decode("utf-8")
print(ResponseData)
.add_header 함수를 사용해 헤더를 추가할 수도 있습니다.'랭귀지 > python' 카테고리의 다른 글
| python pip 특정 버전설치 및 설치 (0) | 2020.02.03 | 
|---|---|
| No module named 'PyQt5.QtWebEngineWidgets' (0) | 2019.12.23 | 
| 장고프레임워크 설치 (0) | 2019.10.27 | 
| [python] 설치된 package 버전 확인 (0) | 2019.10.02 | 
| HTTP Request with Python (0) | 2019.09.09 | 
			  Comments
			
		
	
               
           
					
					
					
					
					
					
				 
								