<?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 Help deleting data input via REST API Please in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Help-deleting-data-input-via-REST-API-Please/m-p/19302#M2725</link>
    <description>&lt;P&gt;I am successfully utilizing the Splunk API through .Net and using GET, POST, and DELETE for many actions and all are working.&lt;/P&gt;

&lt;P&gt;Working until I got to delete data inputs.&lt;/P&gt;

&lt;P&gt;When I copy the exact url from a debugging session of my .Net code and paste it into cUrl, it works great. I am also url encoding the path.&lt;/P&gt;

&lt;P&gt;My .Net code generates the following endpoint for deleting a data input via the rest API&lt;/P&gt;

&lt;P&gt;&lt;A href="https://localhost:8089/services/data/inputs/mon" rel="nofollow"&gt;https://localhost:8089/services/data/inputs/mon&lt;/A&gt;
itor/c%3a%5cprogram+files%5cterso+solutions%5csplunk%5cindex_65b34d3a-463e-4950-8723-409193ee22d6%5cdi&lt;/P&gt;

&lt;P&gt;The directory exists, however when this goes through .Net I get a 404.&lt;/P&gt;

&lt;P&gt;When I take the text and pass it in through cUrl:&lt;/P&gt;

&lt;P&gt;C:&amp;gt;curl -k -u admin:Password01 -X DELETE &lt;A href="https://localhost:8089/services/data/inputs/mon" rel="nofollow"&gt;https://localhost:8089/services/data/inputs/mon&lt;/A&gt;
itor/c%3a%5cprogram+files%5cterso+solutions%5csplunk%5cindex_65b34d3a-463e-4950-8723-409193ee22d6%5cdi&lt;/P&gt;

&lt;P&gt;the data input deletes perfectly.&lt;/P&gt;

&lt;P&gt;Does anyone have any suggestions?&lt;/P&gt;

&lt;P&gt;Thanks.&lt;/P&gt;</description>
    <pubDate>Thu, 30 Dec 2010 05:08:21 GMT</pubDate>
    <dc:creator>sloaniebaloney</dc:creator>
    <dc:date>2010-12-30T05:08:21Z</dc:date>
    <item>
      <title>Help deleting data input via REST API Please</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Help-deleting-data-input-via-REST-API-Please/m-p/19302#M2725</link>
      <description>&lt;P&gt;I am successfully utilizing the Splunk API through .Net and using GET, POST, and DELETE for many actions and all are working.&lt;/P&gt;

&lt;P&gt;Working until I got to delete data inputs.&lt;/P&gt;

&lt;P&gt;When I copy the exact url from a debugging session of my .Net code and paste it into cUrl, it works great. I am also url encoding the path.&lt;/P&gt;

&lt;P&gt;My .Net code generates the following endpoint for deleting a data input via the rest API&lt;/P&gt;

&lt;P&gt;&lt;A href="https://localhost:8089/services/data/inputs/mon" rel="nofollow"&gt;https://localhost:8089/services/data/inputs/mon&lt;/A&gt;
itor/c%3a%5cprogram+files%5cterso+solutions%5csplunk%5cindex_65b34d3a-463e-4950-8723-409193ee22d6%5cdi&lt;/P&gt;

&lt;P&gt;The directory exists, however when this goes through .Net I get a 404.&lt;/P&gt;

&lt;P&gt;When I take the text and pass it in through cUrl:&lt;/P&gt;

&lt;P&gt;C:&amp;gt;curl -k -u admin:Password01 -X DELETE &lt;A href="https://localhost:8089/services/data/inputs/mon" rel="nofollow"&gt;https://localhost:8089/services/data/inputs/mon&lt;/A&gt;
itor/c%3a%5cprogram+files%5cterso+solutions%5csplunk%5cindex_65b34d3a-463e-4950-8723-409193ee22d6%5cdi&lt;/P&gt;

&lt;P&gt;the data input deletes perfectly.&lt;/P&gt;

&lt;P&gt;Does anyone have any suggestions?&lt;/P&gt;

&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Dec 2010 05:08:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Help-deleting-data-input-via-REST-API-Please/m-p/19302#M2725</guid>
      <dc:creator>sloaniebaloney</dc:creator>
      <dc:date>2010-12-30T05:08:21Z</dc:date>
    </item>
    <item>
      <title>Re: Help deleting data input via REST API Please</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Help-deleting-data-input-via-REST-API-Please/m-p/19303#M2726</link>
      <description>&lt;P&gt;This seems to be the same problem we encountered when developing Splunk C# SDK. It is due to URL munging inside .NET. To solve it, you may add genericUriParserOptions="DontUnescapePathDotsAndSlashes" to app.config, or use reflection to change .NET behavior.&lt;/P&gt;

&lt;P&gt;Below is from code of Splunk C# SDK.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    /// &amp;lt;summary&amp;gt;
    /// Constructs a fully qualified URL for this service using a given
    /// path.
    /// &amp;lt;/summary&amp;gt;
    /// &amp;lt;param name="path"&amp;gt;The path.&amp;lt;/param&amp;gt;
    /// &amp;lt;returns&amp;gt;The fully qualified URL.&amp;lt;/returns&amp;gt;
    public Uri GetUrl(string path) 
    {
        // Taken from &lt;A href="http://stackoverflow.com/questions/781205/getting-a-url-with-an-url-encoded-slash" target="test_blank"&gt;http://stackoverflow.com/questions/781205/getting-a-url-with-an-url-encoded-slash&lt;/A&gt;
        // WebRequest can munge an encoded URL, and we don't want it to. 
        // This technique forces WebRequest to leave the URL alone. There is
        // no simple mechanism to ask .Net to do this, once there is, this 
        // code can be changed. This code also may break in the future, as 
        // it reaches into the class's non-public fields and whacks them 
        // with a hammer. 
        //
        // An alternative is to use 
        // genericUriParserOptions="DontUnescapePathDotsAndSlashes"
        // in app.config. However, that is a global setting, which is owned
        // by the application using the Splunk SDK. There's no way to 
        // configure the setting just of the Splunk SDK assembly.
        Uri uri = new Uri(this.Prefix + path);
        string paq = uri.PathAndQuery; // need to access PathAndQuery
        FieldInfo flagsFieldInfo =
            typeof(Uri).GetField(
                "m_Flags", BindingFlags.Instance | BindingFlags.NonPublic);
        ulong flags = (ulong)flagsFieldInfo.GetValue(uri);
        // Flags.PathNotCanonical|Flags.QueryNotCanonical = 0x30
        flags &amp;amp;= ~((ulong)0x30);
        flagsFieldInfo.SetValue(uri, flags);
        return uri;
    }
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 04 Sep 2013 18:44:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Help-deleting-data-input-via-REST-API-Please/m-p/19303#M2726</guid>
      <dc:creator>ywu_splunk</dc:creator>
      <dc:date>2013-09-04T18:44:21Z</dc:date>
    </item>
  </channel>
</rss>

