Forum OpenACS Development: Re: XML-RPC HTTP 302

Collapse
2: Re: XML-RPC HTTP 302 (response to 1)
Posted by Iuri Sampaio on
So far,

in a whole new installation from scratch, from cvs head, I've got the very same bug. HTTP 302 then HTTP 200. Why does xml-rpc always answer with 302 at first?

Using a simple and functional xml-rpc remote call from lars-blogger

catch {xmlrpc::remote_call http://www.evex.co/RPC2 blogger.newPost -string "dsdsddfrerevgrtere" -int 1197 -string "mailto:iuri@iurix.com"; -string "GDGKGJEBSJjvijficFI$#44r45345" -string "text body" -boolean true} result

192.199.241.135 - - [09/Apr/2017:20:57:00 -0400] "POST /RPC2 HTTP/1.0" 302 299 "-" "NaviServer-Tcl/4.99"
192.199.241.135 - - [09/Apr/2017:20:57:00 -0400] "POST /RPC2/ HTTP/1.0" 200 122 "-" "NaviServer-Tcl/4.99"
179.34.179.254 - - [09/Apr/2017:20:57:05 -0400] "GET /test-ws HTTP/1.1" 502 575 "-" "Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.111 Safari/537.36"

Collapse
3: Re: XML-RPC HTTP 302 (response to 2)
Posted by Gustaf Neumann on
Iuri: "Why does xml-rpc always answer with 302 at first?"

Probably, the xml-rpc package is mounted at your instance at __LOCATION__/RPC2/. As always in OpenACS, if one navigates to a mounted package via e.g. __LOCATION__/RPC (without trailing slash), one is redirected to __LOCATION__/RPC/ (with trailing slash).

In your case, when you change the URL in the RPC requester to http://www.evex.co/RPC2/ i would expect that the 302 redirect will disappear.

Hope this helps
-gn

Collapse
4: Re: XML-RPC HTTP 302 (response to 3)
Posted by Iuri Sampaio on
Thanks Gustaf! It works now.

I need to pay more attention. Perhaps I need to rest a little bit.
It was bearing me to madness since it was working in the browser ( with auto redirection) but my python script was breaking ( which doesn't have auto redirection and attempts only once) .

Trailing slash... Arrrrg! 😊

Best wishes,