python - 如何在没有文件的情况下在 Python 正文中发送 multipart/form-data 请求
问题描述
它与其他问题不重复我想知道谁可以将身体数据作为多表单数据发送。在其他问题中,它提到了如何上传文件。我真的没有要上传的文件,或者我可能不知道该怎么做。请帮忙
我必须发送一个 Post 请求,其中正文是 multipart/form-data
import requests
url = 'https://myapp-local/api/address'
headers = {'Accept':'application/json','Content-Type':'multipart/form-data','token': token, 'referer':'https://myapp-local/api/address'}
现在在正文中,我需要发送一些值,例如
address_name=Ram, current_time=1557249595, house_no=303, district=theni, address_type=permemnant
我需要将这些值作为表单数据发送。我怎样才能做到这一点?请帮忙
解决方案
推荐阅读
- javascript - toLocaleString() 不适用于输入更改
- hide - 如何正确使用 react-day-picker-input 中的 hideDayPicker() 公共函数?
- c# - c# Blob Triggered Azure Function V1 with "App Service Plan" 被触发了一些延迟
- azure - Azure 应用服务 - MVC5 WebApp 缺少 css 文件
- google-apps-script - 如何在 Apps 脚本中引用特定列
- ruby-on-rails - 如何在 ruby 1.8 和 rails 2.x 中合并参数中的值
- angular - ngu-carousel ponts 和 changeDetection 的问题
- c++ - Protobuf 动态和静态库
- c# - 检测VM是否被复制
- c# - 使用正则表达式替换字符串;