I tried the same file and it works okay:

"
tanchao@~/workspaces/temp\> python app.py 3333
http://0.0.0.0:3333/
127.0.0.1:64970 - - [27/Mar/2014 06:30:20] "HTTP/1.1 GET /" - 404 Not Found
127.0.0.1:64970 - - [27/Mar/2014 06:30:21] "HTTP/1.1 GET /favicon.ico" - 
404 Not Found
127.0.0.1:64973 - - [27/Mar/2014 06:30:36] "HTTP/1.1 GET /" - 404 Not Found
127.0.0.1:64973 - - [27/Mar/2014 06:30:41] "HTTP/1.1 GET /get" - 200 OK
127.0.0.1:64973 - - [27/Mar/2014 06:30:46] "HTTP/1.1 GET /get/" - 404 Not 
Found
"

Maybe 2 tricky thing need note:
1. indent should be restrictedly follow, don't use tab but spaces
2. /get is different with /get/

Hope it helps.


在 2014年3月20日星期四UTC-4下午5时55分21秒,ling.f%[email protected]写道:
>
> I'm new to webpy and python, I just want to try the basic "hello world" 
> locallly.
>
> GET works OK, but POST returns 405 Method Not Allowed.
>
> Here is my code:
>
> import web
>
> urls = (
>     "/get", "get",
>     "/post", "post"
> )
> app = web.application(urls, globals())
>
> class get:
>     def GET(self):
>         return "get"
>
> class post:
>     def POST(self):
>         return "post"
>
> if __name__ == "__main__":
>     app.run()
>
>
> Anyone will give a hand? Thanks!
>

-- 
You received this message because you are subscribed to the Google Groups 
"web.py" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/webpy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to