共用方式為


HttpCookie.Parse(String) Method

Definition

Constructs cookies from set-cookie or set-cookie2 header string.

[Android.Runtime.Register("parse", "(Ljava/lang/String;)Ljava/util/List;", "")]
public static System.Collections.Generic.IList<Java.Net.HttpCookie>? Parse (string? header);
[<Android.Runtime.Register("parse", "(Ljava/lang/String;)Ljava/util/List;", "")>]
static member Parse : string -> System.Collections.Generic.IList<Java.Net.HttpCookie>

Parameters

header
String

a String specifying the set-cookie header. The header should start with "set-cookie", or "set-cookie2" token; or it should have no leading token at all.

Returns

a List of cookie parsed from header line string

Attributes

Exceptions

if the string does not comply with cookie specification, or the cookie name contains illegal characters, or reserved tokens of cookie specification appears

if header is null

Remarks

Constructs cookies from set-cookie or set-cookie2 header string. RFC 2965 section 3.2.2 set-cookie2 syntax indicates that one header line may contain more than one cookie definitions, so this is a static utility method instead of another constructor.

Java documentation for java.net.HttpCookie.parse(java.lang.String).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to