Re: json objects and PUT/GET Requests/Response

452 views
Skip to first unread message

Masklinn

unread,
Jul 24, 2012, 3:22:04 PM7/24/12
to django...@googlegroups.com

On 2012-07-24, at 21:09 , svs wrote:

> Hello,
>
> I am new to both DJANFGO & REST.
> Here is my problem,I have defined CRUD specific to that of MongoDB in my
> Models.py file, now I am trying to pass data to be written into this DB
> using http PUT requests.
> 1.How parse json objects in the body of HTTP request ?

https://docs.djangoproject.com/en/dev/ref/request-response/#django.http.HttpRequest.body

https://docs.djangoproject.com/en/dev/topics/serialization/ or http://docs.python.org/library/json.html

> 2.How to create HTTP put/get request for test purposes with json objects
> through CLI or GUI.

https://docs.djangoproject.com/en/dev/topics/testing/#making-requests
https://docs.djangoproject.com/en/dev/topics/testing/#django.test.client.Client.put
https://docs.djangoproject.com/en/dev/topics/testing/#django.test.client.Client.get

sanket

unread,
Jul 24, 2012, 4:14:43 PM7/24/12
to django...@googlegroups.com

Hi Svs,

please have a look at django-tastypie (https://github.com/toastdriven/django-tastypie).
it's great for the REST purpose.

Thanks,
sanket



On Tuesday, July 24, 2012 12:09:14 PM UTC-7, svs wrote:
Hello,

I am new to both DJANFGO & REST.
Here is my problem,I have defined CRUD specific to that of MongoDB in my Models.py file, now I am trying to pass data to be written into this DB using http PUT requests.
1.How  parse json objects in the body of HTTP request ?
2.How to create HTTP put/get request for test purposes with json objects through CLI or GUI.

We have client side code(written in PERL) which will actually generate these requests but I want to test my server side code independently.

Thanks,
svs
Reply all
Reply to author
Forward
0 new messages