How to Consume POST Rest API on Django Web? want to consume API of User registration in django and here is the code which i have done
<p>In Views.py
this the code in view.py
def Save(request):</p>

<pre><code>      if request.method == "POST":
            user=request.POST
            email=user.get("email")
            password=user.get("password")
            print "password",password
            display_name= request.POST.get('displayname')
            hometown = request.POST.get('hometown')
            gender = request.POST.get('radios')
            occupation= request.POST.get('occupation')
            services.post_register(email,password,display_name,gender)
</code></pre>

<p>in Service.py code is-
service.py</p>

<pre><code>def post_register(email,password,display_name,gender):
    postdata={'email':email,'password':password,'display_name':display_name,'gender':gender,'}

    response = requests.post('http://www.example.com/rest-auth/users/1/',
                    data=json.dumps(postdata))
</code></pre>

<p>afer running this i am getting response 415. thank you</p>