0
getdrip api docs. Я пытаюсь создать нового абонента, используя POST
. Но requests.post
возвращает 200 не 201.request.post return HTTP 200 python
мой код,
>>> 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]>
>>>
Что плохого я сделал здесь?
Попробуйте 'https: //' в URL. –
@ PM2Ring Спасибо, что сработало. – fledgling
Отлично. Тем не менее, стоит прочитать информацию по URL-адресу в этом предупреждающем сообщении. [InsecurePlatformWarning] (https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning) –