【问题标题】:400 Bad Request: The browser sent a request that this server could not understand (CURL PHP)400 Bad Request:浏览器发送了一个服务器无法理解的请求(CURL PHP)
【发布时间】:2021-08-21 06:47:24
【问题描述】:

我很困惑,我搜索了我的问题,但没有找到我的解决方案 我got error 400 Bad Request: The browser sent a request that this server could not understand如果我在我的卷曲头中使用变量..但是如果我使用字符串这个工作.. 这是我的脚本卷曲标题

$headers = array(
   "Accept: application/json",
   "Connection: keep-alive",
   'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9',
   'Content-Type: application/json',
   "cookie: ".$g,
);

所以如果我像这样在我的数据库中调用变量 $g $g = $reslt->cookie;

我有错误

400 错误请求:浏览器发送了此服务器无法发送的请求 了解

但如果我像这样使用变量 $g $g= 'PHPSESSID=t07gb66oduc55n982al83a7';

这个工作......

如果从我的数据库中调用变量 $g,我想问一下如何让 curl 工作。 即使数据库中的内容是正确的,如果我调用

echo $reslt->cookie;

然后内容显示如下

PHPSESSID=t07gb66oduc55n982al83a7

【问题讨论】:

    标签: php curl


    【解决方案1】:

    已解决..我必须在 $reslt->cookie 中使用修剪;

    【讨论】:

      猜你喜欢
      • 2020-10-17
      • 2021-02-19
      • 2020-03-19
      • 2020-06-11
      • 2021-12-04
      • 2021-06-04
      • 2018-12-20
      • 2018-04-27
      • 2015-11-09
      相关资源
      最近更新 更多