简体   繁体   English

request.post返回HTTP 200 python

[英]requests.post return HTTP 200 python

Following getdrip api docs . getdrip api docs之后 I am trying to create new subscriber using POST . 我正在尝试使用POST创建新的订户。 But requests.post returns 200 not 201. 但是requests.post返回200而不是201。

my code, 我的代码,

>>> 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]>
>>> 

Whats wrong I did here ? 我在这里做什么错了?

The documents says: 文件说:

This document outlines the official specification for the Drip RESTful API. 本文档概述了Drip RESTful API的官方规范。 This API communicates exclusively in JSON over SSL ( HTTPS ). 此API仅通过JSON通过SSL( HTTPS )进行通信。 All endpoint URLs begin with https://api.getdrip.com/v2/ . 所有端点URL均以https://api.getdrip.com/v2/开头。

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

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