gpt4 book ai didi

php - 如何在 PHP 中解析响应头?

转载 作者:可可西里 更新时间:2023-11-01 13:07:25 24 4
gpt4 key购买 nike

<分区>

我已经向 REST API 发出了一个 oauth 签名请求,并将响应 header 放在一个数组中,如下所示:

[0] => HTTP/1.1 200 OK
[1] => Cache-Control: private
[2] => Transfer-Encoding: chunked
[3] => Content-Type: text/html; charset=utf-8
[4] => Content-Location: https://***
[5] => Server: Microsoft-IIS/7.0
[6] => Set-Cookie: ASP.NET_SessionId=***; path=/; HttpOnly
[7] => X-AspNetMvc-Version: 2.0
[8] => oauth_token: ***
[9] => oauth_token_secret: ***
[10] => X-AspNet-Version: 4.0.30319
[11] => X-Powered-By: ASP.NET
[12] => Date: Sat, 15 Sep 2012 02:01:15 GMT

我想知道如何解析 header 以便轻松检索 HTTP 状态代码、内容位置、oauth_token 和 oauth_token_secret 等项目?

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com