Asp.net web api Web api不带回数据

Asp.net web api Web api不带回数据,asp.net-web-api,asp.net-mvc-5,python-requests,Asp.net Web Api,Asp.net Mvc 5,Python Requests,我目前正在使用python请求来使用MVC应用程序中用c#编写的web api。这就是我得到的错误 <body> <div id="header"><h1>Server Error</h1></div> <div id="content"> <div class="content-container"><fieldset> <h2>405 - HTTP verb used to ac

我目前正在使用python请求来使用MVC应用程序中用c#编写的web api。这就是我得到的错误

<body>
<div id="header"><h1>Server Error</h1></div>
<div id="content">
 <div class="content-container"><fieldset>
  <h2>405 - HTTP verb used to access this page is not allowed.</h2>
  <h3>The page you are looking for cannot be displayed because an invalid method (HTTP verb) was used to attempt access.</h3>
 </fieldset></div>
</div>
</body>
urlParam是我传递回webapi以编辑该特定条目的模型。我试着在我的浏览器中键入实际的url,试图通过键入和获取来获取单个条目


您是否得到除“发生错误”之外的错误代码?例如一个500或404?@SamuelDavidson我编辑了从SSH客户端得到的错误代码,Firebug控制台也告诉我我得到了一个500错误。您是否缺少url中的端口号?你能多说一点错误吗?在没有更多信息的情况下,很难找出错误发生的位置和原因。Samuel“NetworkError:500内部服务器错误-”这是我从firebug得到的所有信息,当我在最后去掉id时,似乎所有条目都很好
constURLString = "http://10.1.30.15/test/api/DevicesAPI"
send = requests.put(constURLString + "/" + str(deviceID), data = urlParam)
<Error><Message>An error has occurred.</Message></Error>
// PUT: api/DevicesAPI/5
    [ResponseType(typeof(void))]
    public IHttpActionResult PutDevices(long id, Devices devices)
    {
        if (!ModelState.IsValid)
        {
            return BadRequest(ModelState);
        }

        if (id != devices.deviceID)
        {
            return BadRequest();
        }

        db.Entry(devices).State = EntityState.Modified;

        try
        {
            db.SaveChanges();
        }
        catch (DbUpdateConcurrencyException)
        {
            if (!DevicesExists(id))
            {
                return NotFound();
            }
            else
            {
                throw;
            }
        }

        return StatusCode(HttpStatusCode.NoContent);
    }