<?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 How to diagnose a 400 Bad Request when running a search from C#? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-diagnose-a-400-Bad-Request-when-running-a-search-from-C/m-p/247200#M73742</link>
    <description>&lt;P&gt;I'm still stuck folks...&lt;/P&gt;

&lt;P&gt;I have tried implementing 3 different methods of running a query from C# and none work, all get 400 Bad Request.  I have correct address, port, and credentials.  I cannot even /auth/login.  It works from curl.exe, so I know I have access.&lt;/P&gt;

&lt;P&gt;I need a way to diagnose WHY the request is bad.  Where do I look on the server for USEFUL diagnostics / logs as to why the request is considered bad?&lt;/P&gt;

&lt;P&gt;C# SDK is not an option.  I need to eithe ruse WebClient or HttpWebRequest or hell even tried my own Socket version.  ALL are returning 400 Bad Request.&lt;/P&gt;</description>
    <pubDate>Thu, 19 Jan 2017 20:05:54 GMT</pubDate>
    <dc:creator>RhinoTX</dc:creator>
    <dc:date>2017-01-19T20:05:54Z</dc:date>
    <item>
      <title>How to diagnose a 400 Bad Request when running a search from C#?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-diagnose-a-400-Bad-Request-when-running-a-search-from-C/m-p/247200#M73742</link>
      <description>&lt;P&gt;I'm still stuck folks...&lt;/P&gt;

&lt;P&gt;I have tried implementing 3 different methods of running a query from C# and none work, all get 400 Bad Request.  I have correct address, port, and credentials.  I cannot even /auth/login.  It works from curl.exe, so I know I have access.&lt;/P&gt;

&lt;P&gt;I need a way to diagnose WHY the request is bad.  Where do I look on the server for USEFUL diagnostics / logs as to why the request is considered bad?&lt;/P&gt;

&lt;P&gt;C# SDK is not an option.  I need to eithe ruse WebClient or HttpWebRequest or hell even tried my own Socket version.  ALL are returning 400 Bad Request.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jan 2017 20:05:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-diagnose-a-400-Bad-Request-when-running-a-search-from-C/m-p/247200#M73742</guid>
      <dc:creator>RhinoTX</dc:creator>
      <dc:date>2017-01-19T20:05:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to diagnose a 400 Bad Request when running a search from C#?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-diagnose-a-400-Bad-Request-when-running-a-search-from-C/m-p/247201#M73743</link>
      <description>&lt;P&gt;I figured this out.  The response was being swallowed by the exception being thrown.  Once I started reading the response (in spite of the exception), I was able to see that there was a parse error on the input search string.  The same input string s passed through CURL cmdline, but in that case the double-quotes are removed.  The same double quotes were tripping up the parser.&lt;/P&gt;

&lt;P&gt;This can be closed.&lt;/P&gt;</description>
      <pubDate>Fri, 20 Jan 2017 16:13:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-diagnose-a-400-Bad-Request-when-running-a-search-from-C/m-p/247201#M73743</guid>
      <dc:creator>RhinoTX</dc:creator>
      <dc:date>2017-01-20T16:13:09Z</dc:date>
    </item>
  </channel>
</rss>

