<?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 Re: Http Monitor - get header without brackets in Synthetic Monitoring</title>
    <link>https://community.dynatrace.com/t5/Synthetic-Monitoring/Http-Monitor-get-header-without-brackets/m-p/231225#M2186</link>
    <description>&lt;P&gt;Yes, that was it:&lt;/P&gt;&lt;P&gt;I converted it in string, removed the 2 brackets, and now it works.&lt;/P&gt;&lt;P&gt;Thank you for your help!&lt;/P&gt;&lt;P&gt;Sabine&lt;/P&gt;&lt;P&gt;---------------------------------------------------------------&lt;/P&gt;&lt;P&gt;var resp = String(response.getHeaders().getAll('blabla'));&lt;BR /&gt;var resp1 = resp.substring(1, resp.length - 1);&lt;BR /&gt;api.setValue("myvalue", resp1);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 07 Dec 2023 13:59:21 GMT</pubDate>
    <dc:creator>SabineR</dc:creator>
    <dc:date>2023-12-07T13:59:21Z</dc:date>
    <item>
      <title>Http Monitor - get header without brackets</title>
      <link>https://community.dynatrace.com/t5/Synthetic-Monitoring/Http-Monitor-get-header-without-brackets/m-p/231167#M2181</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I'm building an HTTP monitor and in one HTTP request, I try to get the value of one header.&lt;/P&gt;
&lt;P&gt;The problem is I receive the value with brackets.&lt;BR /&gt;I tried to remove them with replace() or substring() but it is failing: UNKNOWN_METHOD_ERROR&lt;/P&gt;
&lt;P&gt;How can I remove them?&lt;/P&gt;
&lt;P&gt;Many thanks in advance for your answer,&lt;/P&gt;
&lt;P&gt;Warm Regards,&lt;/P&gt;
&lt;P&gt;Sabine&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Example:&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;"responseHeaders": [&lt;BR /&gt;{&lt;BR /&gt;"name": "blabla",&lt;BR /&gt;"value": "myvalue"&lt;BR /&gt;},&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Post script:&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;var resp = response.getHeaders().getAll('blabla');&lt;BR /&gt;api.setValue("myValue", resp);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Result of myValue :&lt;/STRONG&gt;&amp;nbsp;"[myvalue]"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Dec 2023 08:25:51 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Synthetic-Monitoring/Http-Monitor-get-header-without-brackets/m-p/231167#M2181</guid>
      <dc:creator>SabineR</dc:creator>
      <dc:date>2023-12-11T08:25:51Z</dc:date>
    </item>
    <item>
      <title>Re: Http Monitor - get header without brackets</title>
      <link>https://community.dynatrace.com/t5/Synthetic-Monitoring/Http-Monitor-get-header-without-brackets/m-p/231190#M2182</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Maybe this:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var resp = response.getHeaders().getAll('blabla');
resp = resp.replace('[','')
resp = resp.replace(']','')
api.setValue("myValue", resp);&lt;/LI-CODE&gt;&lt;P&gt;But you can explore other ways to remove a character from a string.&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;</description>
      <pubDate>Thu, 07 Dec 2023 11:48:59 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Synthetic-Monitoring/Http-Monitor-get-header-without-brackets/m-p/231190#M2182</guid>
      <dc:creator>AntonPineiro</dc:creator>
      <dc:date>2023-12-07T11:48:59Z</dc:date>
    </item>
    <item>
      <title>Re: Http Monitor - get header without brackets</title>
      <link>https://community.dynatrace.com/t5/Synthetic-Monitoring/Http-Monitor-get-header-without-brackets/m-p/231193#M2183</link>
      <description>&lt;P&gt;I tried it and it failed with error returned:&amp;nbsp;Unknown method or invalid set of parameters.&lt;/P&gt;&lt;P&gt;Same with:&lt;/P&gt;&lt;P&gt;var resp1 = resp.substring(1, resp.length - 1);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Dec 2023 11:54:36 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Synthetic-Monitoring/Http-Monitor-get-header-without-brackets/m-p/231193#M2183</guid>
      <dc:creator>SabineR</dc:creator>
      <dc:date>2023-12-07T11:54:36Z</dc:date>
    </item>
    <item>
      <title>Re: Http Monitor - get header without brackets</title>
      <link>https://community.dynatrace.com/t5/Synthetic-Monitoring/Http-Monitor-get-header-without-brackets/m-p/231215#M2184</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Maybe it because "resp" is not a string and it is an object.&lt;/P&gt;&lt;P&gt;My next actions would be:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Checking type of "&lt;SPAN&gt;resp". Maybe using "typeof".&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;Transform/extract string value.&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;SPAN&gt;Best regards&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Dec 2023 18:25:59 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Synthetic-Monitoring/Http-Monitor-get-header-without-brackets/m-p/231215#M2184</guid>
      <dc:creator>AntonPineiro</dc:creator>
      <dc:date>2023-12-07T18:25:59Z</dc:date>
    </item>
    <item>
      <title>Re: Http Monitor - get header without brackets</title>
      <link>https://community.dynatrace.com/t5/Synthetic-Monitoring/Http-Monitor-get-header-without-brackets/m-p/231225#M2186</link>
      <description>&lt;P&gt;Yes, that was it:&lt;/P&gt;&lt;P&gt;I converted it in string, removed the 2 brackets, and now it works.&lt;/P&gt;&lt;P&gt;Thank you for your help!&lt;/P&gt;&lt;P&gt;Sabine&lt;/P&gt;&lt;P&gt;---------------------------------------------------------------&lt;/P&gt;&lt;P&gt;var resp = String(response.getHeaders().getAll('blabla'));&lt;BR /&gt;var resp1 = resp.substring(1, resp.length - 1);&lt;BR /&gt;api.setValue("myvalue", resp1);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Dec 2023 13:59:21 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Synthetic-Monitoring/Http-Monitor-get-header-without-brackets/m-p/231225#M2186</guid>
      <dc:creator>SabineR</dc:creator>
      <dc:date>2023-12-07T13:59:21Z</dc:date>
    </item>
  </channel>
</rss>

