如何使用没有“Content-Length:0”的Python请求模块执行HTTP DELETE请求?

时间:2016-12-27 20:15:05

标签: python python-requests http-delete content-length http-content-length

我正在使用Python请求模块进行HTTP DELETE,但由于“Content-Length:0”,我在应用程序中遇到了问题。有办法解决这个问题吗?可以删除“Content-Length:0”吗?你有什么建议?

问题是服务器应用程序不接受“Content-Length”,也不接受有效负载。这样,我的请求就不应该有这些信息。

我正在做的请求:

value

1 个答案:

答案 0 :(得分:2)

您可以像在here

中一样手动删除标题

示例:

{
  "description": "NativeScript Application",
  "license": "SEE LICENSE IN <your-license-filename>",
  "readme": "NativeScript Application",
  "repository": "<fill-your-repository-here>",
  "nativescript": {
    "id": "org.nativescript.drawertest",
    "tns-android": {
      "version": "2.4.1"
    }
  },
  "dependencies": {
    "nativescript-telerik-ui": "^1.5.1",
    "nativescript-theme-core": "^0.2.1",
    "tns-core-modules": "2.4.4"
  },
  "devDependencies": {
    "babel-traverse": "6.21.0",
    "babel-types": "6.21.0",
    "babylon": "6.14.1",
    "lazy": "1.0.11",
    "nativescript-dev-android-snapshot": "^0.*.*"
  }
}