-
Notifications
You must be signed in to change notification settings - Fork 326
HTTP class
matecsaj edited this page Jun 12, 2020
·
2 revisions
This HTML class can be used to make traditional HTTP/REST calls.
##Usage
from ebaysdk.http import Connection as HTTP
try:
api = HTTP()
response = api.execute('https://github.com/timotheus/ebaysdk-python/wiki.atom')
print(response.dict())
except ConnectionError as e:
print(e)
print(e.response.content)
Keyword arguments to HTTP() constructor
debug -- debugging enabled (default: False)
method -- GET/POST/PUT (default: GET)
proxy_host -- proxy hostname
proxy_port -- proxy port number
timeout -- HTTP request timeout (default: 20)
parallel -- ebaysdk parallel object
Execute the HTTP request.
api.execute('https://github.com/timotheus/ebaysdk-python/wiki.atom', {'arg1': 'val1'})
Returns a string of the HTTP call errors
if api.error():
print "has errors: %s" % api.error()
Return a DOM object (lxml dom) of the HTTP response content.
Return a dictionary of the HTTP response content.
Return the string content from the HTTP response call.
Return the HTTP response code.
Return the HTTP response status.