matlab.net.http.field.HTTPDateField class
Package: matlab.net.http.field
Superclasses: matlab.net.http.HeaderField
HTTP header field containing date
Description
An HTTPDateField
object is an HTTP header field containing a date. The
fields implemented by this class contain a single date in standard HTTP date format.
Creation
Properties
Name
— Date field name
'Date'
| 'Expires'
| 'Retry-After'
| 'Accept-Datetime'
| 'Last-Modified'
| 'If-Modified-Since'
Date field name, specified as a string of one of these values:
'Date'
, 'Expires'
,
'Retry-After'
, 'Accept-Datetime'
,
'Last-Modified'
, or 'If-Modified-Since'
.
To create a Date
field, use the
matlab.net.http.field.DateField
subclass.
Attributes:
GetAccess | public |
SetAccess | public |
Value
— Date
datetime
| string
Date, specified as a datetime
object or a string in a valid HTTP
date format as specified in RFC 7231 Semantics and Content, section 7.1.1.1. Date/Time
Formats on the Internet Engineering Task Force (IETF®) website. If a datetime
object does not have a time
zone, then it is assumed to be local.
Attributes:
GetAccess | public |
SetAccess | public |
Dependent | true |
Methods
Public Methods
addFields | Add fields to HeaderField array |
removeFields | Remove fields from header field array |
changeFields | Change existing values in HeaderField array |
replaceFields | Change values in or add fields to array of HeaderFields |
getFields | Return header fields matching name or class |
eq | Compare two HeaderField arrays |
convertLike | Convert header field value like another header field |
parse | Parse header field value and return as strings |
displaySubclasses | Display supported HeaderField subclasses |
Specialized for Subclass
Specialized Operators and Functions
These methods specialize standard MATLAB operators and functions for objects in this class.
isequal |
|
string | Array of header fields as string, as it appears in a message. Inserts newline characters between fields but not at the end of all fields. |
char | Array of header fields as character vector, as described by
|
Examples
Display HTTP Date Field
This example shows how to read the HTTP date field in a message.
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"
Version History
Introduced in R2016b
See Also
Beispiel öffnen
Sie haben eine geänderte Version dieses Beispiels. Möchten Sie dieses Beispiel mit Ihren Änderungen öffnen?
MATLAB-Befehl
Sie haben auf einen Link geklickt, der diesem MATLAB-Befehl entspricht:
Führen Sie den Befehl durch Eingabe in das MATLAB-Befehlsfenster aus. Webbrowser unterstützen keine MATLAB-Befehle.
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)