簡體   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