Movatterモバイル変換


[0]ホーム

URL:


menu
  1. Dart
  2. dart:io
  3. HttpHeaders class
HttpHeaders
description

HttpHeaders classabstractinterface

Headers for HTTP requests and responses.

In some situations, headers are immutable:

In these situations, the mutating methods throw exceptions.

For all operations on HTTP headers the header name iscase-insensitive.

To set the value of a header use theset() method:

request.headers.set(HttpHeaders.cacheControlHeader,                    'max-age=3600, must-revalidate');

To retrieve the value of a header use thevalue() method:

print(request.headers.value(HttpHeaders.userAgentHeader));

AnHttpHeaders object holds a list of values for each nameas the standard allows. In most cases a name holds only a single value,The most common mode of operation is to useset() for setting a value,andvalue() for retrieving a value.

Properties

chunkedTransferEncodingbool
Whether the connection uses chunked transfer encoding.
getter/setter pair
contentLengthint
The value of thecontentLengthHeader header, if any.
getter/setter pair
contentTypeContentType?
TheContentType of thecontentTypeHeader header, if any.
getter/setter pair
dateDateTime?
The date specified by thedateHeader header, if any.
getter/setter pair
expiresDateTime?
The date and time specified by theexpiresHeader header, if any.
getter/setter pair
hashCodeint
The hash code for this object.
no setterinherited
hostString?
The value of thehostHeader header, if any.
getter/setter pair
ifModifiedSinceDateTime?
The date and time specified by theifModifiedSinceHeader header, if any.
getter/setter pair
persistentConnectionbool
Whether the connection is persistent (keep-alive).
getter/setter pair
portint?
The value of the port part of thehostHeader header, if any.
getter/setter pair
runtimeTypeType
A representation of the runtime type of the object.
no setterinherited

Methods

add(Stringname,Objectvalue, {boolpreserveHeaderCase =false})→ void
Adds a header value.
clear()→ void
Removes all headers.
forEach(voidaction(Stringname,List<String>values))→ void
Performs theaction on each header.
noFolding(Stringname)→ void
Disables folding for the header namedname when sending the HTTP header.
noSuchMethod(Invocationinvocation)→ dynamic
Invoked when a nonexistent method or property is accessed.
inherited
remove(Stringname,Objectvalue)→ void
Removes a specific value for a header name.
removeAll(Stringname)→ void
Removes all values for the specified header name.
set(Stringname,Objectvalue, {boolpreserveHeaderCase =false})→ void
Sets the headername tovalue.
toString()String
A string representation of this object.
inherited
value(Stringname)String?
Convenience method for the value for a single valued header.

Operators

operator ==(Objectother)bool
The equality operator.
inherited
operator [](Stringname)List<String>?
The values for the header namedname.

Constants

acceptCharsetHeader→ constString
acceptEncodingHeader→ constString
acceptHeader→ constString
acceptLanguageHeader→ constString
acceptRangesHeader→ constString
accessControlAllowCredentialsHeader→ constString
accessControlAllowHeadersHeader→ constString
accessControlAllowMethodsHeader→ constString
accessControlAllowOriginHeader→ constString
accessControlExposeHeadersHeader→ constString
accessControlMaxAgeHeader→ constString
accessControlRequestHeadersHeader→ constString
accessControlRequestMethodHeader→ constString
ageHeader→ constString
allowHeader→ constString
authorizationHeader→ constString
cacheControlHeader→ constString
connectionHeader→ constString
contentDisposition→ constString
contentEncodingHeader→ constString
contentLanguageHeader→ constString
contentLengthHeader→ constString
contentLocationHeader→ constString
contentMD5Header→ constString
contentRangeHeader→ constString
contentTypeHeader→ constString
cookieHeader→ constString
dateHeader→ constString
entityHeaders→ constList<String>
etagHeader→ constString
expectHeader→ constString
expiresHeader→ constString
fromHeader→ constString
generalHeaders→ constList<String>
hostHeader→ constString
ifMatchHeader→ constString
ifModifiedSinceHeader→ constString
ifNoneMatchHeader→ constString
ifRangeHeader→ constString
ifUnmodifiedSinceHeader→ constString
lastModifiedHeader→ constString
locationHeader→ constString
maxForwardsHeader→ constString
pragmaHeader→ constString
proxyAuthenticateHeader→ constString
proxyAuthorizationHeader→ constString
rangeHeader→ constString
refererHeader→ constString
requestHeaders→ constList<String>
responseHeaders→ constList<String>
retryAfterHeader→ constString
serverHeader→ constString
setCookieHeader→ constString
teHeader→ constString
trailerHeader→ constString
transferEncodingHeader→ constString
upgradeHeader→ constString
userAgentHeader→ constString
varyHeader→ constString
viaHeader→ constString
warningHeader→ constString
wwwAuthenticateHeader→ constString
  1. Dart
  2. dart:io
  3. HttpHeaders class
dart:io library

[8]ページ先頭

©2009-2025 Movatter.jp