繁体   English   中英

request.post返回HTTP 200 python

[英]requests.post return HTTP 200 python

getdrip api docs之后 我正在尝试使用POST创建新的订户。 但是requests.post返回200而不是201。

我的代码,

>>> import requests
>>> url = 'http://api.getdrip.com/v2/<id_here>/subscribers'
>>> payload = {'email': 'nishant@gmail.com', 'custom_fields': {'name':'Nishant'}}
>>> headers = {'Authorization': 'Bearer TOKEN_VALUE','Content-Type':'application/vnd.api+json'}
>>> requests.post(url, headers=headers, data=payload)
/home/nishant/env/local/lib/python2.7/site-packages/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
<Response [200]>
>>> 

我在这里做什么错了?

文件说:

本文档概述了Drip RESTful API的官方规范。 此API仅通过JSON通过SSL( HTTPS )进行通信。 所有端点URL均以https://api.getdrip.com/v2/开头。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM