Http Client¶
The Http client is a class which can be instantiated to access web services
via Ajax. It is implemented as an Observable which allows anyone to
subscribe to it and perform operations on the results.
It is located inside anpylar.http. For example:
my_http = anpylar.http.Http()
Class Constructor¶
`Http(url='', headers=None, fullresp=False)`
urlis the base url, which can be later extended when calling a method
headersis a dict with the headers. It can later be extended by each method
fulrespifFalse, the body of responses with status codes between200and299will be returnedIf
Truethe complete response will be returned. It will only be a failure if there is actually a failure in the connection (the browser blocks it, the connection times out, …)
Methods¶
get(url='', headers=None, data=None)Issue a
GETmethod extending theurlandheadersand adding anydatapassedReturns: Observable
post(url='', headers=None, data=None)Issue a
POSTmethod extending theurlandheadersand adding anydatapassedReturns: Observable
put(url='', headers=None, data=None)Issue a
PUTmethod extending theurlandheadersand adding anydatapassedReturns: Observable
delete(url='', headers=None, data=None)Issue a
DELETEmethod extending theurlandheadersand adding anydatapassedReturns: Observable