You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
RestClient is an open source script that depends on requests library
it was developed in 2012 and updated in 2014 by @Khalid Al-hussayen
the script was used for my owen projects so it is limited to my use any one is welcome to update and fix the script.
'''
__author__='khalid'
importurllib2 , hmac , base64
fromhashlibimportsha1
importhmac , requests
importjson
'''
RestClient class is the only class :) it have the four popular http methods (GET,POST,PUT,DELETE) ,
to use the RestClient you need to declare object from it inilize the host with the base url and resource with your url resource ,
Then you can call any methods get or post etc.. the http responce will be hold in the reponce object
call responce.json() if you want the data parce to json or responce.text for the plain data and res.responce.status_code.
responce is an requests responce object for more information you can see this url http://docs.python-requests.org/en/latest/user/quickstart/#response-content