How to call the rpc interface

Asked by Roel Vanhout

I found nitroshare today and I thought I'd add support for sending a file through the windows explorer context menu. I'd run the software in the debugger but my Qt is still compiling so I figured I'd ask first ;) The context menu itself is easy, what I'm trying to do is find a way to call the nitroshare executable with the path to a file to send as the argument. It seems most logical to do that in main() where it is detected anyway if nitroshare is already running. In that case, I thought I could use the xmlrpc interface to start sending a file. So now we're getting to my question: how do I format the xmlrpc request for starting an upload. I though this should work:

<?xml version="1.0"?>
<methodCall>
   <methodName>SendFiles</methodName>
      <params>
         <param>
            <value>
               <array>
                  <data>
                     <value><string>C:\test.txt</string></value>
                     <value><string>c:\test2.txt</string></value>
                  </data>
               </array>
            </value>
         </param>
      </params>
</methodCall>

but all I get when I POST this (with curl.exe, like this: curl.exe --data-urlencode "<email address hidden>" http://localhost:41722 ), the POST just hangs and the call never returns.

So, should this work? What is the right syntax to get nitroshare to start sharing a file through xmlrpc?

Question information

Language:
English Edit question
Status:
Solved
For:
NitroShare Edit question
Assignee:
No assignee Edit question
Solved by:
Roel Vanhout
Solved:
Last query:
Last reply:
Revision history for this message
Roel Vanhout (roel-vanhout) said :
#1

OK never mind, the problem was that I was calling my test POST wrong - should have been curl.exe --data @request.txt -H "Content-Type:text/xml" http://127.0.0.1:41722/ . Then I get the nitroshare dialog popping up.