Pyjamas txJSON-RPC examples may be broken

Bug #456454 reported by Duncan McGreggor
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
txJSON-RPC
New
Medium
Duncan McGreggor

Bug Description

Terry Jones reported that he couldn't get the pyjamas txSJON-RPC examples to work. If this is a problem with the txJSON-RPC lib, it needs to be fixed. If it's a problem with the pyjamas examples, that needs to be communicated to upstream.

Revision history for this message
Duncan McGreggor (oubiwann) wrote :

Here are some notes from Terry in an IRC chat:

[09:10] <terrycojones> i tried the pyjamas book example, followed it closely, but doesn't want to work for me. i get:
[09:10] <terrycojones> Method Not Allowed
[09:10] <terrycojones> The requested method POST is not supported by /output/test_slide.txt.
[09:10] <terrycojones> 405
[09:17] <terrycojones> their code: HTTPRequest().asyncPost("test_slide.txt", "", SlideLoader(self))
[09:17] <terrycojones> looks wrong. seems like that should be "/test".

Changed in txjsonrpc:
assignee: nobody → Duncan McGreggor (oubiwann)
importance: Undecided → Medium
Changed in txjsonrpc:
milestone: none → 0.4
Revision history for this message
Terry Jones (terrycojones) wrote :

I verified that hitting the twisted.web2 server with

$ curl -d '{"params":["blahblah"],"method":"echo"}' http://localhost:7080/test/

was working. (Note that this is twisted.web2 since that's the example used in the Pyjamas book.)

The book example isn't very clear about what you're supposed to do. I used
root = static.File(".")
and ran twistd in that same dir (the one that contains the output directory after running
pyjsbuild Slideshow.py. Then visit http://localhost:7080/output/Slideshow.html in your browser.

At least according to http://pyjs.org/book/output/Bookreader.html#Rest%20of%20the%20World
you should have root.putChild("test", Example()) in your server.tac file, which is what led
me to comment that the line in the example with HTTPRequest().asyncPost("test_slide.txt"
seems wrong (try it, you'll see an error about not being able to POST to /test_slide.txt)
so I tried with "/test" which produces the text of the Twistd server's echo call
(i.e., the call is made, and the returned JSON is simply displayed in the browser - which
is to say that it looks nothing like a slideshow :-))

And at that point I stopped...

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.