import mrequests

host = 'http://httpbin.org/'
#host = "http://localhost/"
url = host + "image"
filename = "image.png"
r = mrequests.get(url, headers={b"accept": b"image/png"})

if r.status_code == 200:
    r.save(filename)
    print("Image saved to '{}'.".format(filename))
else:
    print("Request failed. Status: {}".format(r.status_code))

r.close()

Add example for saving request data to file
Add example for saving request data to file

Signed-off-by: Christopher Arndt <711c73f64afdce07b7e38039a96d2224209e9a6c@chrisarndt.de>
