NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Developers v
« Previous 1 2 3 4 5 … 93 Next »
API request returns xml on error

 
  • 0 Vote(s) - 0 Average
API request returns xml on error
scJohn
Offline

Senior Member

Posts: 281
Threads: 41
Joined: Jun 2013
#1
2020-08-24, 09:32 PM (This post was last modified: 2020-08-24, 09:36 PM by scJohn. Edit Reason: added status code )
I have the following fetch API:

PHP Code:
fetch(`http://localhost:8866/services/service?method=recording.save&format=json&event_id=11579903`) 

I am requesting 'format=json'.

When i get an good(valid event_id) response I get a json response: info [recurringRecording.js]: response "{\"stat\":\"ok\"}\r\n"

When i get an error(invalid event_id) response I get xml: info [recurringRecording.js]: response "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\r\n<rsp stat=\"fail\">\r\n  <err code=\"2\" msg=\"Invalid Args\" />\r\n</rsp>\r\n"

Status Code is 200 for both requests.

Am I doing something wrong or is this a bug.
Thanks
Server:
CPU- Intel I5-8400, Ram -12GB, SSD - 128GB, HDD - 1TB, Turners - Hauppauge WinTV-quadHD, OS - Win 10 Home, Router - TP-Link Archer C7(AC1750).

Clients:
Intel NUC CPU - Intel N3700, RAM - 4GB, SSD - 128GB, OS - Win 10, Wired Ethernet.
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,661
Threads: 767
Joined: Nov 2003
#2
2020-08-24, 10:00 PM
Is that the current 5.0.8 release?
mvallevand
Offline

Posting Freak

Ontario Canada
Posts: 52,839
Threads: 954
Joined: May 2006
#3
2020-08-24, 10:15 PM (This post was last modified: 2020-08-24, 10:17 PM by mvallevand.)
I can't duplicate this in v5 but since you aren't using a sid there are potential errors anyway with ipv6.

I can confirm this with the legacy v4 server.

Martin
scJohn
Offline

Senior Member

Posts: 281
Threads: 41
Joined: Jun 2013
#4
2020-08-25, 02:20 PM
This is for version 4.2.4 (190307). I have not migrated to version 5.

Also, at least with version 4, this API does not check for duplicates. The API will schedule another instance of the event_id even if an existing record once has already be scheduled. Just run the the API 3 times with the same event_id and you will have 3 instances in the SCHEDULED_RECORDING table.
Server:
CPU- Intel I5-8400, Ram -12GB, SSD - 128GB, HDD - 1TB, Turners - Hauppauge WinTV-quadHD, OS - Win 10 Home, Router - TP-Link Archer C7(AC1750).

Clients:
Intel NUC CPU - Intel N3700, RAM - 4GB, SSD - 128GB, OS - Win 10, Wired Ethernet.
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,661
Threads: 767
Joined: Nov 2003
#5
2020-08-25, 05:41 PM
I'm intending to do any further 4.x releases. The problem with it returning xml in this error case was fixed in v5.
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)



Possibly Related Threads…
Thread Author Replies Views Last Post
  is there a service?method which returns listings for multiple channels? reven 16 6,820 2022-04-11, 04:30 PM
Last Post: mandai
  custom creation of a recurring error p37307 2 2,221 2017-12-19, 03:45 AM
Last Post: mvallevand
  Waking a PC with a network request bgowland 3 2,188 2011-05-17, 10:38 AM
Last Post: doogle
  NPVR NewStyleButtonListPlugin request whurlston 4 1,953 2010-06-16, 06:49 PM
Last Post: whurlston
  ScheduleHelper.SheduleRecording returns Nothing MaidenQuebec 7 2,996 2009-03-20, 12:21 PM
Last Post: Ernie-c
  PluginHelper.GetSkinRootDirectory(); returns "skin" and not "skin2" reven 6 2,457 2009-02-11, 03:15 PM
Last Post: sub
  How do I request wake-up? bgowland 4 2,127 2009-02-08, 10:35 PM
Last Post: bgowland
  Weather Plugin Error Smoker 26 7,595 2009-02-01, 05:52 AM
Last Post: n00dle
  Video play queue request. whurlston 2 1,707 2008-12-17, 08:12 PM
Last Post: whurlston
  SQL Error - Failed to enable constraints. One or more rows contain values violating n ralphy 6 3,742 2008-02-06, 10:03 AM
Last Post: ralphy

  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D, modified by NextPVR - Powered by MyBB

Linear Mode
Threaded Mode