I have a rest server that can be called e.g. with:
http://localhost:8080/myserver/rest/books/t1.json
I want to know how can I use from django rest framework as a client and call my rest server?
I have a rest server that can be called e.g. with:
http://localhost:8080/myserver/rest/books/t1.json
I want to know how can I use from django rest framework as a client and call my rest server?
Django Rest Framework is for creating REST APIs, not consuming them. To simply call a REST API from Django/Python you can do the following using json and urllib2 which are standard:
import json
import urllib2
data = json.load(urllib2.urlopen('http://myapi.com/'))
or you can use the 3rd party library requests:
import requests
r = requests.get('http://myapi.com/')
r.json()