EVE-SECURE / eveapiproxy

Automatically exported from code.google.com/p/eveapiproxy
0 stars 0 forks source link

Unable to POST to the API #3

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
Attempts to POST data to any api url results in an error.
Error: (In an html response) The request method <code>POST</code> is 
inappropriate for the URL <code>/char/CharacterSheet.xml.aspx</code>.
URL: http://eveapiproxy.appspot.com/char/CharacterSheet.xml.aspx
Example:
curl -d "name=foo" http://eveapiproxy.appspot.com/char/
CharacterSheet.xml.aspx

What is the expected output? What do you see instead?
If I were to simply remove the POST data argument, I get the following 
(correct) error from CCP.
<?xml version='1.0' encoding='UTF-8'?>
<eveapi version="2">
  <currentTime>2009-02-16 06:09:08</currentTime>
  <error code="106">Must provide userID parameter for authentication.</
error>
  <cachedUntil>2009-02-16 06:14:08</cachedUntil>
</eveapi>

Original issue reported on code.google.com by dekim...@gmail.com on 16 Feb 2009 at 6:11

GoogleCodeExporter commented 9 years ago
Interesting.  I would have expected this to work.  The proxy gets the arguments 
via
the arguments() and get(argument) methods of Google's Request Class
(http://code.google.com/appengine/docs/python/tools/webapp/requestclass.html) 
which
"Returns a list of the names of query (URL) or POST data arguments."

I will have to look closer at this -- may be a couple of days till I can address
though.  Thanks for the bug report!

Original comment by Erik.E.E...@gmail.com on 16 Feb 2009 at 3:10

GoogleCodeExporter commented 9 years ago

Original comment by Erik.E.E...@gmail.com on 16 Feb 2009 at 3:11

GoogleCodeExporter commented 9 years ago
It's still broken.

Original comment by Xavura on 17 Jul 2009 at 4:25

GoogleCodeExporter commented 9 years ago
GET works, POST does not.

Seems to be a problem with the Google App Engine Request class' arguments() 
method
(http://code.google.com/appengine/docs/python/tools/webapp/requestclass.html#Req
uest_arguments).
 For some reason arguments() is returning GET parameters but not POST parameters. 
Line 25 of main.py is the key part of the code.

Original comment by Erik.E.E...@gmail.com on 17 Jul 2009 at 4:39

GoogleCodeExporter commented 9 years ago
Any updates on the status of this? I'd like to run all of my API tools through 
this
proxy to make it easier for my different programs to keep up with the latest 
API data.

Thanks

Original comment by zae...@gmail.com on 8 Sep 2009 at 4:03

GoogleCodeExporter commented 9 years ago
Sorry, I do not know why the arguments() function is returning GET parameters 
but not
POST parameters as described in comment #4.  Perhaps someone with more python
knowledge than I can assist.

Original comment by Erik.E.E...@gmail.com on 8 Sep 2009 at 4:16

GoogleCodeExporter commented 9 years ago
the problem is that you handle get requests but don't handle posts at all.

everything will work if you simply add

    def post(self):
        self.get()

to the Proxy class.

Original comment by dafire@gmail.com on 29 Sep 2009 at 10:57

GoogleCodeExporter commented 9 years ago
I have added dafire's suggestion.  Please let me know if the change fixes the 
isssue.

Best,

Erik

Original comment by Erik.E.E...@gmail.com on 6 Dec 2009 at 11:42

GoogleCodeExporter commented 9 years ago
I have confirmed that eveapiproxy works with curl.

Original comment by Erik.E.E...@gmail.com on 7 Dec 2009 at 1:10

GoogleCodeExporter commented 9 years ago

Original comment by Erik.E.E...@gmail.com on 7 Dec 2009 at 1:14

GoogleCodeExporter commented 9 years ago
Had to fix a small indentation error.  Verified that POST is working via a curl 
-d
command.

Original comment by Erik.E.E...@gmail.com on 7 Dec 2009 at 1:33