Sign in to follow this  
AdPzazz

What Should The Api Return?

Recommended Posts

Hello, All.

 

I'm struggling a bit; any guidance is much appreciated!

 

I can successfully launch btsync /config sync.conf with login, password and api_key via my application.  And I can submit a simple request (get_version) via HTTP POST and receive a 200 status response (assuming this means success). However, GetAllResponseHeaders returns the following:(see below) instead of the JSON response expected and shown in the API documentation ({ "version": "1.3.94" })

 
Returned Results:
 
   Connection: Keep-Alive
   Date: Thu, 15 May 2014 14:22:15 GMT
   Keep-Alive: timeout=5, max=99
   Content-Length: 594
   Content-Type: text/html
   Server: Apache/2.2.21 (Win32) mod_ssl/2.2.21 OpenSSL/1.0.0e PHP/5.3.8 mod_perl/2.0.4 Perl/v5.10.1
   X-Powered-By: PHP/5.3.8
 
I've looked several places for assistance using HTTP, POST/GET format, but can not find the magic solution.  is there a switch somewhere that needs to be set so that plain text is returned?
 
My assumption is that I can control adding folders, files, setting secrets, etc from within the app using the API functionality; just missing how to handle returned results.
 
Again, thanks for any direction!

Share this post


Link to post
Share on other sites

When you try to request the following resource (using your browser for example):

 

http://127.0.0.1:8888/api?method=get_version

 

This is assuming you are testing on the localhost, otherwise modify the address

You may also have to modify the port, check your config file for details.

 

Do you get valid JSON data or not? If not, the configuration file may be invalid.

Share this post


Link to post
Share on other sites

Appreciate the reply...

 

Yes, I did all of my initial testing through the browser to understand what needs to be sent and what should be returned. The response via the browser is correct.

 

May not be able to accomplish my initial goal (bury all sync efforts within a Windows desktop app.) with BTSync.  Looked like it would have worked well.

 

Again, thanks for the reply.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this