New Question
 
 
PRTG Network Monitor

Intuitive to Use.
Easy to manage.

200.000 administrators have chosen PRTG to monitor their network. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free PRTG
Download >>

 

What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general. You are invited to get involved by asking and answering questions!

Learn more

 

Top Tags


View all Tags


REST API Wrong Response Headers

Votes:

0

Your Vote:

Up

Down

Hello,

I am making calls to the HTTP REST API but it looks like the response returned by PRTG has the incorrect response content headers.

For example I make a call like: GET /api/table.xml?username=prtgadmin&passhash=xxxxxx&content=sensors&columns=device%2C+type%2C+sensor%2C+status%2C+lastvalue%2C+group%2C+lastdown%2C+lastcheck%2C+lastup,message&output=xml HTTP/1.1 Host: 10.xx.xxx.xxx Accept: application/xml user-agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) advanced-rest-client/12.1.4 Chrome/61.0.3163.100 Electron/2.0.2 Safari/537.36

As you can see I have the output query parameter and the Accept request header both set to XML.

The response I receive does contain XML in the body but the content-type header in the response message is says HTML. Thus my code tries to handle the response as HTML and not XML.

For example, the response headers I receive look like: connection: close content-type: text/html; charset=UTF-8 content-length: 134918 date: Fri, 12 Oct 2018 21:37:25 GMT expires: 0 cache-control: cache, must-revalidate x-content-type-options: nosniff x-xss-protection: 1; mode=block content-disposition: attachment; filename=table.xml pragma: public server: PRTG/18.3.44.2059

I would think that since XML is being returned in the message body then the message header should have a content-type of application/xml as is standard with REST APIs. Having XML return with an HTML content-type seems to violate the HTTP paradigm.

Thanks

api http-api xml

Created on Oct 12, 2018 9:44:31 PM by  astropcr (0) 1



Best Answer

Accepted Answer

Votes:

0

Your Vote:

Up

Down

This should be fixed in PRTG v18.4.46.1754 :)


PRTG Scheduler | PRTGapi | Feature Requests | WMI Issues | SNMP Issues

Kind regards,
Stephan Linke, Tech Support Team

Created on Nov 22, 2018 1:18:14 PM by  Stephan Linke [Paessler Support]



2 Replies

Votes:

1

Your Vote:

Up

Down

Hi Astropcr,

I have to agree with you, this looks like a bug. I will open a development ticket for further analysis/fixing the issue.

Thank you very much for letting us know!

Kind regards


Andreas Günther
Tech Support, Paessler AG

Created on Oct 15, 2018 3:08:43 PM by  Andreas Günther [Paessler Support]



Accepted Answer

Votes:

0

Your Vote:

Up

Down

This should be fixed in PRTG v18.4.46.1754 :)


PRTG Scheduler | PRTGapi | Feature Requests | WMI Issues | SNMP Issues

Kind regards,
Stephan Linke, Tech Support Team

Created on Nov 22, 2018 1:18:14 PM by  Stephan Linke [Paessler Support]



Please log in or register to enter your reply.


Disclaimer: The information in the Paessler Knowledge Base comes without warranty of any kind. Use at your own risk. Before applying any instructions please exercise proper system administrator housekeeping. You must make sure that a proper backup of all your data is available.