matlab.net.http.field.HTTPDateField クラス
名前空間: matlab.net.http.field
スーパークラス: matlab.net.http.HeaderField
日付を含む HTTP ヘッダー フィールド
説明
HTTPDateField
オブジェクトは日付を含む HTTP ヘッダー フィールドです。このクラスによって実装されたフィールドには、標準の HTTP 日付書式の 1 つの日付が含まれます。
作成
プロパティ
Name
— 日付フィールド名
'Date'
| 'Expires'
| 'Retry-After'
| 'Accept-Datetime'
| 'Last-Modified'
| 'If-Modified-Since'
日付フィールド名。'Date'
、'Expires'
、'Retry-After'
、'Accept-Datetime'
、'Last-Modified'
または 'If-Modified-Since'
のいずれかの文字列として指定します。
Date
フィールドを作成するには matlab.net.http.field.DateField
サブクラスを使用します。
属性:
GetAccess | public |
SetAccess | public |
Value
— 日付
datetime
| string
日付。datetime
オブジェクト、または RFC 7231 Semantics and Content、セクション 7.1.1.1. の Date/Time Formats (Internet Engineering Task Force (IETF®) の Web サイト上) で指定されている有効な HTTP 日付書式の string として指定します。datetime
オブジェクトにタイム ゾーンがない場合は、ローカルのタイム ゾーンが想定されます。
属性:
GetAccess | public |
SetAccess | public |
Dependent | true |
メソッド
パブリック メソッド
addFields | HeaderField 配列へのフィールドの追加 |
removeFields | ヘッダー フィールド配列からフィールドを削除 |
changeFields | HeaderField 配列内の既存値を変更 |
replaceFields | HeaderFields の配列の値を変更またはフィールドを追加 |
getFields | 名前またはクラスが一致するヘッダー フィールドを返す |
eq | 2 つの HeaderField 配列の比較 |
convertLike | ヘッダー フィールド値を別のヘッダー フィールドと同様に変換 |
parse | ヘッダー フィールド値を解析して string として返す |
displaySubclasses | サポートされる HeaderField サブクラスの表示 |
サブクラスに特化
特殊な演算子と関数
次のメソッドは、MATLAB の標準の演算子および関数を、このクラスのオブジェクト用に特殊化したものです。
isequal |
|
string | string としてのヘッダー フィールドの配列。メッセージに表示されます。フィールド間に改行文字を挿入しますが、すべてのフィールドの最後には挿入しません。 |
char |
|
例
HTTP 日付フィールドの表示
この例では、メッセージの HTTP 日付フィールドを読み取る方法を示します。
import matlab.net.*; import matlab.net.http.*; import matlab.net.http.field.*; httpsUrl = 'https://requestserver.mathworks.com'; uri = URI(strcat(httpsUrl, '/assets/computerVision.jpg')); headers = DateField(datetime("today")); req = RequestMessage('GET', headers); response = req.send(uri); httpDateField = response.getFields("Last-Modified"); disp(httpDateField)
HTTPDateField with properties: Name: "Last-Modified" Value: "Fri, 02 Apr 2021 20:14:03 GMT"
バージョン履歴
R2016b で導入
MATLAB コマンド
次の MATLAB コマンドに対応するリンクがクリックされました。
コマンドを MATLAB コマンド ウィンドウに入力して実行してください。Web ブラウザーは MATLAB コマンドをサポートしていません。
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)