FAQ  •  Register  •  Login

API Documentation - JSON

<<

will

DLNA master

Posts: 2122

Joined: Mon Aug 30, 2010 11:18 am

Location: UK

Post Tue Dec 06, 2011 5:02 pm

API Documentation - JSON

Just a quick thing, could you update the API Documentation "Section 2.1 XML or JSON" to note that you need to add the header "Accept: application/json" if you want serviio to respond with json. You noted that you need to set Content-Type so I did that and I then spent 20 min wondering why the response was xml. Mostly my fault as its my first attempt at writing anything that uses webservices, but hopefully it will save someone else some time.
Will
Beta Tester Group
ServiiDroid (Android Console) Developer: Download | Home | Support
ServiiGo (Android 3G/4G/WiFi Playback App) Developer: More info

Player: Sony BDP S370 | Server: Debian 6.0 x86
HowTo: Provide supported formats of a device HowTo: Record a new ticket on Bitbucket
HowTo: Provide details of a video file that doesn't play
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 16851

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Tue Dec 06, 2011 5:26 pm

Re: API Documentation - JSON

will do thanks
<<

kairoh

DLNA master

Posts: 178

Joined: Sun Aug 08, 2010 10:41 am

Location: France

Post Tue Dec 06, 2011 9:42 pm

Re: API Documentation - JSON

To use json you can either :
- Set HTTP header "Accept: application/json" to your requests.
- Add "media=json" to your request parameters (in URL or in submitted forms).
For example :
http://localhost:23423/rest/application => get XML response
http://localhost:23423/rest/application?media=json => get JSON response

Or use both...
Serviio WebUI console developer : New Homepage | Support | Project | Issues

Samsung UA32C6600 | WinXP / Ubuntu 11.10 | Samsung Galaxy S | Freebox v6
HowTo: Provide supported formats of a device HowTo: Record a new ticket on Bitbucket
HowTo: Provide details of a video file that doesn't play HowTo: Turn on detailed logging
<<

will

DLNA master

Posts: 2122

Joined: Mon Aug 30, 2010 11:18 am

Location: UK

Post Wed Dec 07, 2011 11:43 am

Re: API Documentation - JSON

kairoh wrote:http://localhost:23423/rest/application?media=json => get JSON response


Thanks, that will be useful for testing things out quickly without using CURL.
Will
Beta Tester Group
ServiiDroid (Android Console) Developer: Download | Home | Support
ServiiGo (Android 3G/4G/WiFi Playback App) Developer: More info

Player: Sony BDP S370 | Server: Debian 6.0 x86
HowTo: Provide supported formats of a device HowTo: Record a new ticket on Bitbucket
HowTo: Provide details of a video file that doesn't play

Return to Third-party tools integration

Who is online

Users browsing this forum: No registered users and 1 guest

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.