| | |
formatting a url to send to a python server
![]() |
•
•
Join Date: Mar 2009
Posts: 1
Reputation:
Solved Threads: 0
There is a html page that has a form on it, with a text field named "text". When you enter text into that that field and submit it, it goes back to the python server, gets processed, and a new html page is sent out in response.
I'm working with a java servlet and need to post to the python server. The easiest way I can think of to do this is to format the url such that the the text I would like to enter into the text field (whose name is 'text'), I somehow encode that information in the url.
In Java, I'd simply append to the end of the url [text=theTextIdLikeToProcess]. But, that doesn't work for the python server. It is expecting a dictionary, and it tries to search that dictionary for a key labeled 'text'.
So, how to I encode a url to give a post command that will put the key 'text', with a value I want, in the dictionary?
thanks!
I'm working with a java servlet and need to post to the python server. The easiest way I can think of to do this is to format the url such that the the text I would like to enter into the text field (whose name is 'text'), I somehow encode that information in the url.
In Java, I'd simply append to the end of the url [text=theTextIdLikeToProcess]. But, that doesn't work for the python server. It is expecting a dictionary, and it tries to search that dictionary for a key labeled 'text'.
So, how to I encode a url to give a post command that will put the key 'text', with a value I want, in the dictionary?
thanks!
this post might help:
http://www.webhostingtalk.com/showpo...40&postcount=2
you should just be able to add it to the end as an additional argument, it would seem...
http://www.webhostingtalk.com/showpo...40&postcount=2
you should just be able to add it to the end as an additional argument, it would seem...
Alex Cavnar, aka alc6379
![]() |
Other Threads in the Python Forum
- Previous Thread: Get chat text from a window
- Next Thread: image opening + closing
| Thread Tools | Search this Thread |
abrupt alarm ansi anti approximation assignment avogadro backend beginner binary bluetooth calculator character cmd code customdialog cx-freeze data decimals dictionaries dictionary directory dynamic error examples exe file float format function gnu graphics gui halp heads homework http ideas import input java launcher leftmouse line linux list lists loop module mouse number numbers output parsing path pointer port prime programming progressbar projects push py2exe pygame pyglet pyqt python random recursion schedule screensaverloopinactive script scrolledtext sqlite statistics string strings sudokusolver sum table terminal text thread threading time tlapse tricks tuple tutorial twoup ubuntu unicode urllib urllib2 variable ventrilo wikipedia write wxpython xlib






