REST 客户端与代码扩展不发送请求

时间:2021-05-01 20:07:03

标签: api rest visual-studio-code vscode-extensions rest-client

我一直在尝试使用 Vs Code REST 客户端扩展发出 API GET 请求,但它一直给出状态代码 400 的错误。我尝试通过浏览器发出请求并且成功了,所以我确定问题不是来自我的代码。这是错误的样子:

HTTP/1.1 400 Bad Request
Date: Sun, 02 May 2021 03:54:28 GMT
Server: Apache/2.4.25 (Win32) OpenSSL/1.0.2j PHP/7.1.1
Vary: accept-language,accept-charset
Accept-Ranges: bytes
Connection: close
Content-Type: text/html; charset=utf-8
Content-Language: en

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>Bad request!</title>
<link rev="made" href="mailto:admin@example.com" />
<style type="text/css"><!--/*--><![CDATA[/*><!--*/ 
    body { color: #000000; background-color: #FFFFFF; }
    a:link { color: #0000CC; }
    p, address {margin-left: 3em;}
    span {font-size: smaller;}
/*]]>*/--></style>
</head>

<body>
<h1>Bad request!</h1>
<p>


    Your browser (or proxy) sent a request that
    this server could not understand.

</p>
<p>
If you think this is a server error, please contact
the <a href="mailto:admin@example.com">webmaster</a>.

</p>

<h2>Error 400</h2>
<address>
  <a href="/">www.example.com</a><br />
  <span>Apache/2.4.25 (Win32) OpenSSL/1.0.2j PHP/7.1.1</span>
</address>
</body>
</html>

0 个答案:

没有答案