Requests_Utility_CaseInsensitiveDictionary
云策文档标注
概述
Requests_Utility_CaseInsensitiveDictionary 是一个用于处理 HTTP 头部的字典类,支持大小写不敏感的键操作。它提供了构造、获取、迭代和数组访问等方法。
关键要点
- 类名:Requests_Utility_CaseInsensitiveDictionary,专为 HTTP 头部设计
- 核心功能:大小写不敏感的键值存储,适用于处理 HTTP 头部(如 Content-Type 或 content-type)
- 主要方法:包括 __construct(构造)、getAll(获取数组)、getIterator(迭代器)、offsetExists(检查存在)、offsetGet(获取值)、offsetSet(设置值)、offsetUnset(删除项)
- 应用场景:在 WordPress 的 Requests 库中,被 Requests_Response_Headers 类用于管理响应头部
原文内容
Case-insensitive dictionary, suitable for HTTP headers
Methods
| Name | Description |
|---|---|
| Requests_Utility_CaseInsensitiveDictionary::__construct | Creates a case insensitive dictionary. |
| Requests_Utility_CaseInsensitiveDictionary::getAll | Get the headers as an array |
| Requests_Utility_CaseInsensitiveDictionary::getIterator | Get an iterator for the data |
| Requests_Utility_CaseInsensitiveDictionary::offsetExists | Check if the given item exists |
| Requests_Utility_CaseInsensitiveDictionary::offsetGet | Get the value for the item |
| Requests_Utility_CaseInsensitiveDictionary::offsetSet | Set the given item |
| Requests_Utility_CaseInsensitiveDictionary::offsetUnset | Unset the given header |