Akretion/prestapyt — pull request #1 by leblanc-simon (2012-07-31 22:28:00+00:00)
Title: Remove all 401 HTTP Status code

With actual code, each api call generate 2 requests :
- first return "401 Unauthorized"
- second is the good request

This pull request allow to call the api with only one request by forcing to send authentification. Prestashop doesn't allow to call api without authentification, thus send automaticaly authentification is safe.

2 avantages :
- remove all 401 request in the web server's log
- reduce the number of request, thus the call will be faster

The http client is created in the __init__ (https://github.com/leblanc-simon/prestapyt/blob/master/prestapyt/prestapyt.py#L106) to create only one httplib2.Http object for one PrestaShopWebService object :
- less code to execute if you call _execute more than once
- reuse the same connection for all call to _execute