Skip to content

Instantly share code, notes, and snippets.

@leblanc-simon
Created July 31, 2012 19:21
Show Gist options
  • Save leblanc-simon/3219713 to your computer and use it in GitHub Desktop.
Save leblanc-simon/3219713 to your computer and use it in GitHub Desktop.
HTTP status return with prestapyt
from prestapyt import PrestaShopWebServiceError, PrestaShopWebService, PrestaShopWebServiceDict
prestashop = PrestaShopWebServiceDict('http://localhost/api', '098F6BCD4621D373CADE4E832627B4F6')
prestashop.search('addresses') # 401 + 200 : OK, it's the first call
prestashop.get('addresses', 4) # 200 only: OK
prestashop.get('addresses', 6) # 200 only: OK
prestashop.search('orders') # 401 + 200 : NOK, it must be only 200
prestashop.get('orders', 2) # 200 only: OK
prestashop.get('orders', 5) # 200 only: OK
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment