简体   繁体   中英

requests.post return HTTP 200 python

Following getdrip api docs . I am trying to create new subscriber using POST . But requests.post returns 200 not 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. This API communicates exclusively in JSON over SSL ( HTTPS ). All endpoint URLs begin with https://api.getdrip.com/v2/ .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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