Skip to content

Instantly share code, notes, and snippets.

@offby1
Created June 20, 2015 19:32
Show Gist options
  • Select an option

  • Save offby1/aa528d7413ed468e4cf2 to your computer and use it in GitHub Desktop.

Select an option

Save offby1/aa528d7413ed468e4cf2 to your computer and use it in GitHub Desktop.
import bigcommerce
import logging
logging.basicConfig (level=logging.DEBUG)
api = bigcommerce.api.BigcommerceApi(host='https://store-45eg5.mybigcommerce.com/api/v2/', basic_auth=('henry', '10f0f4f371f7953c4d7d7809b62463281f15c829'))
print(api.Products.all())
@offby1
Copy link
Copy Markdown
Author

offby1 commented Jun 20, 2015

./venv/bin/python wat.py 
INFO:bigcommerce.connection:API Host: https://store-45eg5.mybigcommerce.com/api/v2///api/v2/{}
DEBUG:bigcommerce.connection:GET https://https://store-45eg5.mybigcommerce.com/api/v2//api/v2/products
https://https://store-45eg5.mybigcommerce.com/api/v2//api/v2/products
https://https//store-45eg5.mybigcommerce.com/api/v2//api/v2/products
INFO:requests.packages.urllib3.connectionpool:Starting new HTTPS connection (1): https
Traceback (most recent call last):
  File "wat.py", line 7, in <module>
    print(api.Products.all())
  File "/private/tmp/venv/lib/python2.7/site-packages/bigcommerce/api.py", line 57, in <lambda>
    return lambda *args, **kwargs: (getattr(self.resource_class, item))(*args, connection=self.connection, **kwargs)
  File "/private/tmp/venv/lib/python2.7/site-packages/bigcommerce/resources/base.py", line 100, in all
    request = cls._make_request('GET', cls._get_all_path(), connection, params=params)
  File "/private/tmp/venv/lib/python2.7/site-packages/bigcommerce/resources/base.py", line 42, in _make_request
    return connection.make_request(method, url, data, params, headers)
  File "/private/tmp/venv/lib/python2.7/site-packages/bigcommerce/connection.py", line 120, in make_request
    response = self._run_method(method, url, data, params, headers)
  File "/private/tmp/venv/lib/python2.7/site-packages/bigcommerce/connection.py", line 72, in _run_method
    return self._session.request(method, url, data=data, timeout=self.timeout, headers=headers)
  File "/private/tmp/venv/lib/python2.7/site-packages/requests/sessions.py", line 465, in request
    resp = self.send(prep, **send_kwargs)
  File "/private/tmp/venv/lib/python2.7/site-packages/requests/sessions.py", line 574, in send
    r = adapter.send(request, **kwargs)
  File "/private/tmp/venv/lib/python2.7/site-packages/requests/adapters.py", line 415, in send
    raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', gaierror(8, 'nodename nor servname provided, or not known'))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment