【问题标题】:What is default header content-type for http post method in curl form? [duplicate]curl 形式的 http post 方法的默认标头内容类型是什么? [复制]
【发布时间】:2016-10-09 15:42:59
【问题描述】:

我正在使用带有属性值的 html 表单的 POST 方法的 curl 命令。我正在使用烧瓶框架。我的内容类型不是 application-json。

我给出的带有标题的命令如下:

curl -b cookies.txt -F "description=description" -F "file_name=@curl_commands.md"  -X POST http://localhost:5000/api/v1.0/upload_doc
-H 'workflow_id:1' -H 'change_workflow:Y'

我应该为 Content-type 指定什么:?这是 js ajax 调用所必需的。

【问题讨论】:

  • Jivan 感谢您的澄清!

标签: python ajax curl flask


【解决方案1】:

这个网址的答案很清楚:application/x-www-form-urlencodedmultipart/form-data

【讨论】:

  • 这个答案回答了问题,但不是问题的标题。如果这有意义的话。如果我们做curl -X POST -d @somefile,默认的内容类型是什么?
猜你喜欢
  • 2010-12-20
  • 2013-12-11
  • 1970-01-01
  • 2016-04-17
  • 2011-01-19
  • 2011-04-05
  • 1970-01-01
  • 2023-03-05
  • 2012-01-27
相关资源
最近更新 更多