title: Why is it that "No HTTP resource was found that matches the request URI" here?
body: <p>I have code in my controller like so:</p>
  
  <pre><code>[Route("api/deliveryitems/InsertIntoPPTData/{stringifiedRecord}")]
  </code></pre>
  
  <p>...and I'm calling it via Postman like so:</p>
  
  <pre><code>    http://localhost:21609/api/deliveryitems/InsertIntoPPTData?
  stringifiedRecord=serNum77;tx2;siteNum2;bla2.xml;ppt_user2;tx_memo2;file_beg2;file_end2
  </code></pre>
  
  <p>...but get:</p>
  
  <pre><code>{
  Message: "No HTTP resource was found that matches the request URI     
  'http://localhost:21609/api/deliveryitems/InsertIntoPPTData?   stringifiedRecord=serNum77;tx2;siteNum2;bla2.xml;ppt_user2;tx_memo2;file_beg2;file_end2'."
  MessageDetail: "No type was found that matches the controller named 'deliveryitems'."
  }
  </code></pre>
  
  <p>Other REST methods that are created and called in the same way are found just fine - why not this one? The only thing it does not have in common with the others is that it is a HttpPost, whereas the others are HttpGet. Does that make that much of a difference? I <em>am</em> selecting "Post" from the dropdown in Postman when trying to call this REST method.</p>
  
  <h2>UPDATE</h2>
  
  <p>Yes, it apparently has nothing to do with it being a Post and passing args in the URI, because I'm getting the same thing now with an HttpGet method:</p>
  
  <pre><code>{
  Message: "No HTTP resource was found that matches the request URI     
  'http://localhost:21609/api/department/getndeptsfromid?firstId=2&amp;countToFetch=12'."
  MessageDetail: "No action was found on the controller 'Department' that matches the request."
  }
  </code></pre>
  
  <p>I'm calling it from postman like so:</p>
  
  <pre><code>http://localhost:21609/api/department/getndeptsfromid?firstId=2&amp;countToFetch=12
  </code></pre>
  
  <p>...and it does indeed appear in my controller:</p>
  
  <pre><code>[HttpGet]
  [Route("api/department/getndeptsfromid/{firstId}/{countToFetch}")]
  public List&lt;Department&gt; GetNDepartmentsFromID(int FirstId, int CountToFetch)
  {
      return CCRService.GetNDepartmentsFromID(FirstId, CountToFetch);
  }
  </code></pre>
  
  <h2>UPDATE 2</h2>
  
  <p>I thought I was about to solve it when I changed this code:</p>
  
  <pre><code>String.Format("api/department/getndeptsfromid/{0}/{1}", FirstId, CountToFetch)
  </code></pre>
  
  <p>...to this:</p>
  
  <pre><code>String.Format("api/department/getndeptsfromid?firstId={0}&amp;countToFetch={1}", FirstId, CountToFetch)
  </code></pre>
  
  <p>...but I still get the same err msg...</p>
  
  <h2>UPDATE 3</h2>
  
  <p>I find that this also is not working:</p>
  
  <pre><code>http://localhost:21609/api/delivery/invnumbyid?ID=33
  </code></pre>
  
  <p>...and so there is a definite pattern. EVERY REST API call I make that contains args/params fails in this same way; all of the others (<code>http://localhost:21609/api/deliveries/Count, http://localhost:21609/api/deliveryitems/count, http://localhost:21609/api/department/getall</code>) work just fine. IOW, if there are no args in the URI, the method is discovered. If there <em>are</em> args, it is not.</p>
  
  <p>So apparently there's either something wrong with how I'm passing the args/vals in the URI (appending "<strong>?=</strong>" in the case of a single arg and, in the case of two args "<strong>?=&amp;=</strong>") and/or there's something wrong with how I set up the routing. Specifically, this style works:</p>
  
  <pre><code>[Route("api/Deliveries/Count")]
  </code></pre>
  
  <p>...whereas this style does not:</p>
  
  <pre><code>[Route("api/delivery/invnumbyid/{ID}")]
  </code></pre>
  
  <p>I will bountify this question ASAP - 50 points to the untangler of this Gordiesque knot, and 100 if it's answered today (prior to the setting up of the bounty).</p>
  
  <h2>UPDATE 4</h2>
  
  <p>I changed the routing to include the data type of the arg so that this:</p>
  
  <pre><code>[Route("api/delivery/invnumbyid/{ID}")]
  </code></pre>
  
  <p>-became  this:</p>
  
  <pre><code>[Route("api/delivery/invnumbyid/{ID:int}")]"
  </code></pre>
  
  <p>But it still failed, growling:</p>
  
  <pre><code>{
  Message: "No HTTP resource was found that matches the request URI 
  'http://localhost:21609/api/delivery/invnumbyid?ID=45'."
  MessageDetail: "No action was found on the controller 'Delivery' that matches the request."
  }
  </code></pre>
  
  <p>Then, "on a lark," I tried entering this into Postman:</p>
  
  <pre><code>http://localhost:21609/api/delivery/invnumbyid/45
  </code></pre>
  
  <p>...and it worked! (I had been thinking it needed to be "<code>http://localhost:21609/api/delivery/invnumbyid?ID=45</code>")</p>
  
  <p>But a similar attempt in Postman:</p>
  
  <pre><code>http://localhost:21609/api/department/getndeptsfromid/2/12/
  </code></pre>
  
  <p>...continues to fail with "No value given for one or more required parameters." even though this is hit:</p>
  
  <pre><code>[HttpGet]
  [Route("api/department/getndeptsfromid/{firstId}/{countToFetch}")]
  public List&lt;Department&gt; GetNDepartmentsFromID(int FirstId, int CountToFetch)
  {
      return HHSService.GetNDepartmentsFromID(FirstId, CountToFetch);
  }
  </code></pre>
  
  <p>...and the args to GetNDepartmentsFromID() has the expected vals (2 and 12)</p>
  
  <p>Even worse/weirder is the result I get with "<code>http://localhost:21609/api/deliveryitems/InsertIntoPPTData/serNum77;tx2;siteNum2;bla2.xml;ppt_user2;tx_memo2;file_beg2;file_end2</code>" now:</p>
  
  <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;
  &lt;html
      xmlns="http://www.w3.org/1999/xhtml"&gt;
      &lt;head&gt;
          &lt;title&gt;IIS 8.0 Detailed Error - 404.0 - Not Found&lt;/title&gt;
          &lt;style type="text/css"&gt;
              &lt;!-- 
  body{margin:0;font-size:.7em;font-family:Verdana,Arial,Helvetica,sans-serif;} 
  code{margin:0;color:#006600;font-size:1.1em;font-weight:bold;} 
  .config_source code{font-size:.8em;color:#000000;} 
  pre{margin:0;font-size:1.4em;word-wrap:break-word;} 
  ul,ol{margin:10px 0 10px 5px;} 
  ul.first,ol.first{margin-top:5px;} 
  fieldset{padding:0 15px 10px 15px;word-break:break-all;} 
  .summary-container fieldset{padding-bottom:5px;margin-top:4px;} 
  legend.no-expand-all{padding:2px 15px 4px 10px;margin:0 0 0 -12px;} 
  legend{color:#333333;;margin:4px 0 8px -12px;_margin-top:0px; 
  font-weight:bold;font-size:1em;} 
  a:link,a:visited{color:#007EFF;font-weight:bold;} 
  a:hover{text-decoration:none;} 
  h1{font-size:2.4em;margin:0;color:#FFF;} 
  h2{font-size:1.7em;margin:0;color:#CC0000;} 
  h3{font-size:1.4em;margin:10px 0 0 0;color:#CC0000;} 
  h4{font-size:1.2em;margin:10px 0 5px 0; 
  }#header{width:96%;margin:0 0 0 0;padding:6px 2% 6px 2%;font-family:"trebuchet MS",Verdana,sans-serif; 
   color:#FFF;background-color:#5C87B2; 
  }#content{margin:0 0 0 2%;position:relative;} 
  .summary-container,.content-container{background:#FFF;width:96%;margin-top:8px;padding:10px;position:relative;} 
  .content-container p{margin:0 0 10px 0; 
  }#details-left{width:35%;float:left;margin-right:2%; 
  }#details-right{width:63%;float:left;overflow:hidden; 
  }#server_version{width:96%;_height:1px;min-height:1px;margin:0 0 5px 0;padding:11px 2% 8px 2%;color:#FFFFFF; 
   background-color:#5A7FA5;border-bottom:1px solid #C1CFDD;border-top:1px solid #4A6C8E;font-weight:normal; 
   font-size:1em;color:#FFF;text-align:right; 
  }#server_version p{margin:5px 0;} 
  table{margin:4px 0 4px 0;width:100%;border:none;} 
  td,th{vertical-align:top;padding:3px 0;text-align:left;font-weight:normal;border:none;} 
  th{width:30%;text-align:right;padding-right:2%;font-weight:bold;} 
  thead th{background-color:#ebebeb;width:25%; 
  }#details-right th{width:20%;} 
  table tr.alt td,table tr.alt th{} 
  .highlight-code{color:#CC0000;font-weight:bold;font-style:italic;} 
  .clear{clear:both;} 
  .preferred{padding:0 5px 2px 5px;font-weight:normal;background:#006633;color:#FFF;font-size:.8em;} 
  --&gt;
          &lt;/style&gt;
      &lt;/head&gt;
      &lt;body&gt;
          &lt;div id="content"&gt;
              &lt;div class="content-container"&gt;
                  &lt;h3&gt;HTTP Error 404.0 - Not Found&lt;/h3&gt;
                  &lt;h4&gt;The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.&lt;/h4&gt;
              &lt;/div&gt;
              &lt;div class="content-container"&gt;
                  &lt;fieldset&gt;
                      &lt;h4&gt;Most likely causes:&lt;/h4&gt;
                      &lt;ul&gt;
                          &lt;li&gt;The directory or file specified does not exist on the Web server.&lt;/li&gt;
                          &lt;li&gt;The URL contains a typographical error.&lt;/li&gt;
                          &lt;li&gt;A custom filter or module, such as URLScan, restricts access to the file.&lt;/li&gt;
                      &lt;/ul&gt;
                  &lt;/fieldset&gt;
              &lt;/div&gt;
              &lt;div class="content-container"&gt;
                  &lt;fieldset&gt;
                      &lt;h4&gt;Things you can try:&lt;/h4&gt;
                      &lt;ul&gt;
                          &lt;li&gt;Create the content on the Web server.&lt;/li&gt;
                          &lt;li&gt;Review the browser URL.&lt;/li&gt;
                          &lt;li&gt;Check the failed request tracing log and see which module is calling SetStatus. For more information, click 
                              &lt;a href="http://go.microsoft.com/fwlink/?LinkID=66439"&gt;here&lt;/a&gt;. 
                          &lt;/li&gt;
                      &lt;/ul&gt;
                  &lt;/fieldset&gt;
              &lt;/div&gt;
              &lt;div class="content-container"&gt;
                  &lt;fieldset&gt;
                      &lt;h4&gt;Detailed Error Information:&lt;/h4&gt;
                      &lt;div id="details-left"&gt;
                          &lt;table border="0" cellpadding="0" cellspacing="0"&gt;
                              &lt;tr class="alt"&gt;
                                  &lt;th&gt;Module&lt;/th&gt;
                                  &lt;td&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;IIS Web Core&lt;/td&gt;
                              &lt;/tr&gt;
                              &lt;tr&gt;
                                  &lt;th&gt;Notification&lt;/th&gt;
                                  &lt;td&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;MapRequestHandler&lt;/td&gt;
                              &lt;/tr&gt;
                              &lt;tr class="alt"&gt;
                                  &lt;th&gt;Handler&lt;/th&gt;
                                  &lt;td&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;StaticFile&lt;/td&gt;
                              &lt;/tr&gt;
                              &lt;tr&gt;
                                  &lt;th&gt;Error Code&lt;/th&gt;
                                  &lt;td&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;0x80070002&lt;/td&gt;
                              &lt;/tr&gt;
                          &lt;/table&gt;
                      &lt;/div&gt;
                      &lt;div id="details-right"&gt;
                          &lt;table border="0" cellpadding="0" cellspacing="0"&gt;
                              &lt;tr class="alt"&gt;
                                  &lt;th&gt;Requested URL&lt;/th&gt;
                                  &lt;td&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;http://localhost:21609/api/deliveryitems/InsertIntoPPTData/serNum77;tx2;siteNum2;bla2.xml;ppt_user2;tx_memo2;file_beg2;file_end2&lt;/td&gt;
                              &lt;/tr&gt;
                              &lt;tr&gt;
                                  &lt;th&gt;Physical Path&lt;/th&gt;
                                  &lt;td&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;C:\project\git\CStore\HHS.API\api\deliveryitems\InsertIntoPPTData\serNum77;tx2;siteNum2;bla2.xml;ppt_user2;tx_memo2;file_beg2;file_end2&lt;/td&gt;
                              &lt;/tr&gt;
                              &lt;tr class="alt"&gt;
                                  &lt;th&gt;Logon Method&lt;/th&gt;
                                  &lt;td&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Anonymous&lt;/td&gt;
                              &lt;/tr&gt;
                              &lt;tr&gt;
                                  &lt;th&gt;Logon User&lt;/th&gt;
                                  &lt;td&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Anonymous&lt;/td&gt;
                              &lt;/tr&gt;
                              &lt;tr class="alt"&gt;
                                  &lt;th&gt;Request Tracing Directory&lt;/th&gt;
                                  &lt;td&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;C:\Users\clay\Documents\IISExpress\TraceLogFiles\HHS.API&lt;/td&gt;
                              &lt;/tr&gt;
                          &lt;/table&gt;
                          &lt;div class="clear"&gt;&lt;/div&gt;
                      &lt;/div&gt;
                  &lt;/fieldset&gt;
              &lt;/div&gt;
              &lt;div class="content-container"&gt;
                  &lt;fieldset&gt;
                      &lt;h4&gt;More Information:&lt;/h4&gt; 
    This error means that the file or directory does not exist on the server. Create the file or directory and try the request again. 
  
                      &lt;p&gt;
                          &lt;a href="http://go.microsoft.com/fwlink/?LinkID=62293&amp;amp;IIS70Error=404,0,0x80070002,7601"&gt;View more information &amp;raquo;&lt;/a&gt;
                      &lt;/p&gt;
                  &lt;/fieldset&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/body&gt;
  &lt;/html&gt; 
  </code></pre>
  
  <p>¡Que demonios!</p>
  
  <p>I sadly smilingly remember that there is always one more gargoyle hiding behind the rustling curtain (where Robinson Jeffers and Edgar Allen Poe are seemingly wrestling). Palely loitering...</p>
  
  <h2>UPDATE 5</h2>
  
  <p>Okay, here it is stated differently:</p>
  
  <p>From Postman, if I use this URL: </p>
  
  <pre><code>http://localhost:21609/api/department/getndeptsfromid/2/12/
  </code></pre>
  
  <p>I make it into this method:</p>
  
  <pre><code>[HttpGet]
  [Route("api/department/getndeptsfromid/{firstId}/{countToFetch}")]
  public List&lt;Department&gt; GetNDepartmentsFromID(int FirstId, int CountToFetch)
  {
      return HHSService.GetNDepartmentsFromID(FirstId, CountToFetch);
  }
  </code></pre>
  
  <p>...where the value of FirstId is 2, and the value of CountToFetch is 12 (as I would expect them to be). But then, Postman sends back my package with the notation, "<strong><em>500 No value given for one or more required parameters.</em></strong>"</p>
  
  <p>¡Que demonios! Both parameters were obviously passed!</p>
  
  <p>If I use a URI that would seem more correct:</p>
  
  <pre><code>http://localhost:21609/api/department/getndeptsfromid?firstId=2&amp;countToFetch=12
  </code></pre>
  
  <p>I get:</p>
  
  <pre><code>{
  Message: "No HTTP resource was found that matches the request URI   
  'http://localhost:21609/api/department/getndeptsfromid?firstId=2&amp;countToFetch=12'."
  MessageDetail: "No action was found on the controller 'Department' that matches the request."
  }
  </code></pre>
  
  <p>Yet this is the route that I've provided:</p>
  
  <pre><code>[Route("api/department/getndeptsfromid/{firstId}/{countToFetch}")]
  </code></pre>
  
  <p>...and so I would say that I did, in fact, provide a matching action on the controller.And, BTW, if I just enter this as the URI into Postman:</p>
  
  <pre><code>http://localhost:21609/api/department/getndeptsfromid
  </code></pre>
  
  <p>...and then use Postman's "URL Parameter Key / Value" interface to add those, it generates the exact same URL as above, as can be seen here:</p>
  
  <p><img src="https://i.stack.imgur.com/ywbCp.png" alt="enter image description here"></p>
  
  <p>...and with the exact same result.</p>
  
  <p>I can only say it again (pardon my "<em>Las Uvas de la Ira</em>"-inspired Spanish): <strong><em>¡Que demonios!</em></strong></p>