当前位置:网站首页>Get webkitformboundary post login
Get webkitformboundary post login
2022-07-07 20:10:00 【nongcunqq】
Key points post when headers in boundary and data Medium boundary The data should be consistent 'Content-Type': f'multipart/form-data; boundary=----{web_boundary}',
Random generation 16 Bit case letters + Numbers
import requests
import random,string
from requests_toolbelt import MultipartEncoder
fields = {
'file': ('test.png', your_data, "image/png"),
'file_id': "0"
}
boundary = '----WebKitFormBoundary' \
+ ''.join(random.sample(string.ascii_letters + string.digits, 16))
m = MultipartEncoder(fields=fields, boundary=boundary)
headers = {
"Host": "xxxx",
"Connection": "keep-alive",
"Content-Type": m.content_type
}
req = requests.post('https://xxxx/api/upload', headers=headers, data=m)
print(req.text)
Reference resources
https://stackoverflow.com/questions/51349340/recreate-post-request-with-webkitformboundary-using-pythons-requests
边栏推荐
- R language ggplot2 visualization: use the ggstripchart function of ggpubr package to visualize the dot strip plot, set the position parameter, and configure the separation degree of different grouped
- Force buckle 674 Longest continuous increasing sequence
- 力扣 2315.统计星号
- equals 方法
- sql 常用优化
- Browse the purpose of point setting
- The state cyberspace Office released the measures for data exit security assessment: 100000 information provided overseas needs to be declared
- 841. String hash
- The DBSCAN function of FPC package of R language performs density clustering analysis on data, checks the clustering labels of all samples, and the table function calculates the two-dimensional contin
- Throughput
猜你喜欢
Force buckle 599 Minimum index sum of two lists
Automatic classification of defective photovoltaic module cells in electroluminescence images-论文阅读笔记
Vulnhub tre1
Yolov6:yolov6+win10--- train your own dataset
Some important knowledge of MySQL
Vulnhub's funfox2
力扣 2319. 判断矩阵是否是一个 X 矩阵
LeetCode力扣(剑指offer 36-39)36. 二叉搜索树与双向链表37. 序列化二叉树38. 字符串的排列39. 数组中出现次数超过一半的数字
Detailed explanation of Flink parallelism and slot
mock.js从对象数组中任选数据返回一个数组
随机推荐
R language ggplot2 visualization: use the ggecdf function of ggpubr package to visualize the grouping experience cumulative density distribution function curve, and the linetype parameter to specify t
841. String hash
openEuler 资源利用率提升之道 01:概论
LeetCode_ 7_ five
开源重器!九章云极DataCanvas公司YLearn因果学习开源项目即将发布!
vulnhub之tre1
【STL】vector
8 CAS
JVM class loading mechanism
力扣 1037.有效的回旋镖
干货分享|DevExpress v22.1原版帮助文档下载集合
Nunjuks template engine
831. KMP string
vulnhub之Funfox2
Time tools
LeetCode_7_5
关于自身的一些安排
Yolov6:yolov6+win10--- train your own dataset
Equals method
torch. nn. functional. Pad (input, pad, mode= 'constant', value=none) record