Nishant Nawarkhede
Nishant Nawarkhede

Reputation: 8398

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': '[email protected]', '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 ?

Upvotes: 0

Views: 867

Answers (1)

luoluo
luoluo

Reputation: 5533

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/.

Upvotes: 1

Related Questions