<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic JSON response from URL Connector can not be parsed in Streaming Analytics</title>
    <link>https://communities.sas.com/t5/Streaming-Analytics/JSON-response-from-URL-Connector-can-not-be-parsed/m-p/914184#M310</link>
    <description>&lt;P&gt;Hi Everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am looking for advice on a problematic JSON response from an API.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The API response in question contains a "formula" field which contains some kind of interval written as: "x&amp;gt;400 &amp;amp;&amp;amp; x&amp;lt;1700".&lt;/P&gt;&lt;P&gt;From what I can see in other tools, including Python, Lua, Notepad++ &amp;amp; Firefox, the JSON is valid and parses correctly. In ESP however, when the JSON comes through, no error shows, but no data comes through either.&lt;/P&gt;&lt;P&gt;When looking at the ESP-Server-Pod's logs I saw that that "formula" field was throwing errors because of unexpected or wrong html syntax... (see log screencap attached)&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="VMoraal_0-1706868932905.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/93204i669DBA75E2B9F5AD/image-size/medium?v=v2&amp;amp;px=400" role="button" title="VMoraal_0-1706868932905.png" alt="VMoraal_0-1706868932905.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone have any idea how I can force ESP to just pass the response to a proper JSON parser and just ignore these HTML errors?&lt;BR /&gt;Because the way I see it, these errors aren't relevant for the parsing of the JSON as #1: this field is ignored, and #2: this isn't HTML it's JSON...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance for the help and advice &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 02 Feb 2024 10:18:44 GMT</pubDate>
    <dc:creator>VMoraal</dc:creator>
    <dc:date>2024-02-02T10:18:44Z</dc:date>
    <item>
      <title>JSON response from URL Connector can not be parsed</title>
      <link>https://communities.sas.com/t5/Streaming-Analytics/JSON-response-from-URL-Connector-can-not-be-parsed/m-p/914184#M310</link>
      <description>&lt;P&gt;Hi Everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am looking for advice on a problematic JSON response from an API.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The API response in question contains a "formula" field which contains some kind of interval written as: "x&amp;gt;400 &amp;amp;&amp;amp; x&amp;lt;1700".&lt;/P&gt;&lt;P&gt;From what I can see in other tools, including Python, Lua, Notepad++ &amp;amp; Firefox, the JSON is valid and parses correctly. In ESP however, when the JSON comes through, no error shows, but no data comes through either.&lt;/P&gt;&lt;P&gt;When looking at the ESP-Server-Pod's logs I saw that that "formula" field was throwing errors because of unexpected or wrong html syntax... (see log screencap attached)&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="VMoraal_0-1706868932905.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/93204i669DBA75E2B9F5AD/image-size/medium?v=v2&amp;amp;px=400" role="button" title="VMoraal_0-1706868932905.png" alt="VMoraal_0-1706868932905.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone have any idea how I can force ESP to just pass the response to a proper JSON parser and just ignore these HTML errors?&lt;BR /&gt;Because the way I see it, these errors aren't relevant for the parsing of the JSON as #1: this field is ignored, and #2: this isn't HTML it's JSON...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance for the help and advice &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Feb 2024 10:18:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Streaming-Analytics/JSON-response-from-URL-Connector-can-not-be-parsed/m-p/914184#M310</guid>
      <dc:creator>VMoraal</dc:creator>
      <dc:date>2024-02-02T10:18:44Z</dc:date>
    </item>
    <item>
      <title>Re: JSON response from URL Connector can not be parsed</title>
      <link>https://communities.sas.com/t5/Streaming-Analytics/JSON-response-from-URL-Connector-can-not-be-parsed/m-p/914185#M311</link>
      <description>&lt;P&gt;Additional context to the question above.&lt;BR /&gt;&lt;BR /&gt;The API in question is being queried using the URL Connector with an XML file which defines the following headers as well as the JSON parsing for events generation:&lt;/P&gt;&lt;P&gt;Authorization: "Basic [key]"&lt;/P&gt;&lt;P&gt;Content-Type: "application/json"&lt;/P&gt;</description>
      <pubDate>Fri, 02 Feb 2024 10:24:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Streaming-Analytics/JSON-response-from-URL-Connector-can-not-be-parsed/m-p/914185#M311</guid>
      <dc:creator>VMoraal</dc:creator>
      <dc:date>2024-02-02T10:24:05Z</dc:date>
    </item>
    <item>
      <title>Re: JSON response from URL Connector can not be parsed</title>
      <link>https://communities.sas.com/t5/Streaming-Analytics/JSON-response-from-URL-Connector-can-not-be-parsed/m-p/914192#M312</link>
      <description>&lt;P&gt;Dear VMoraal,&lt;BR /&gt;&lt;BR /&gt;I think it is time for you to pack your bag and start your weekend... You clearly can't read.&lt;BR /&gt;&lt;BR /&gt;The problem was due to the lack of declaration of the content-type in the request name. Somehow my brain was stuck somewhere else.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Other users beware! If you don't declare the content type, ESP will read the response of your request as HTML.&lt;/P&gt;&lt;PRE&gt;&amp;lt;request name="api_query" contentType="application/json"&amp;gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 02 Feb 2024 12:56:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Streaming-Analytics/JSON-response-from-URL-Connector-can-not-be-parsed/m-p/914192#M312</guid>
      <dc:creator>VMoraal</dc:creator>
      <dc:date>2024-02-02T12:56:25Z</dc:date>
    </item>
  </channel>
</rss>

