Skip to main content
1-Visitor
January 12, 2015
Question

REST API - POST Accept parameters - How to get pain text

  • January 12, 2015
  • 0 replies
  • 1325 views

Hi All

I need to created a REST serves that responds with plain text.

The API is (Appkey omitted for clarity)

<myServer>/Thingworx/Things/WWXWaterwaySensorTestDataGenerator/Services/OutputTest?method=Post

If I make the request without a Accept parameter I get a web/html page

<myServer>/Thingworx/Things/WWXWaterwaySensorTestDataGenerator/Services/OutputTest?method=Post&Accept=text/xml

I can use either accept=Application/JSON, Text/XML, Text/CSV to get JSON, XML or a CSV file but I really want just the text.  If I use text/plan I get HTML - which is not what I'd expect.

Is it possible to get plain text and if so what are the correct accept parameters?

Thanks