Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.

#1 Jan. 29, 2011 05:25:58

sami n.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

QUERYDICT immutable


HI
I am NEWBIE i am trying to run an server and my POST request is from
java api(client) and i cant able to see exact error in java api its just
showing HTML request is not accepting in java b coz django giving me error
iin html format but by some how i manage to print request.POST from my
request
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
<QueryDict: {u'<?xml version': }>
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
now i want to change just message in my request.POST (denoted by red color
in above request) and i am helpless i tried the following code

def recive_ShortMessage(request):
if request.method == 'POST':
request=request.POST.QueryDict.copy()
qt=request.QueryDict.copy()
print qt
qt = 'I am changing it!'
return HttpResponse(qt)
_____________________________________________________________________________________________________________________
_____________________________________________________________________________________________________________________

As java api is not showing what error i am having i can know error in this
program

--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.

Offline

#2 Jan. 29, 2011 12:23:04

Andy M.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

QUERYDICT immutable


On 2011-01-29, at 5:25 AM, sami nathan wrote:
> now i want to change just message in my request.POST (denoted by red color in
> above request) and i am helpless i tried the following code
>
> def recive_ShortMessage(request):
> if request.method == 'POST':
> request=request.POST.QueryDict.copy()
> qt=request.QueryDict.copy()
> print qt
> qt = 'I am changing it!'
> return HttpResponse(qt)

So presumably a) you'll want to parse the soap into some python datastructure
then b) alter it and then c) serialise it back out as the new value. So you'll
need to find a python SOAP library, suds might do it:https://fedorahosted.org/suds/Please note that the HttpResponse takes a string, not a dictionary as you are
trying to use. Documented here:http://docs.djangoproject.com/en/dev/ref/request-response/#httpresponse-objects--
Andy McKay
a...@clearwind.ca
twitter: @andymckay


--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.

Offline

Board footer

Moderator control

Enjoy the 20th of October
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support