SocketTools .NET Edition

HttpClient.GetHeader Method 

Return the value of the specified response header field.

[Visual Basic]
Public Function GetHeader( _
   ByVal headerName As String, _
   ByRef headerValue As String _
) As Boolean
[C#]
public bool GetHeader(
   string headerName,
   ref string headerValue
);

Parameters

headerName
A string that specifies the name of the header field.
headerValue
A string passed by reference that will contain the value of the specified header field.

Return Value

This method returns a Boolean value. If the method succeeds, the return value is true. If the method fails, the return value is false. To get extended error information, check the value of the LastError property.

Remarks

The GetHeader method is used get the value of a specific header field from the response headers returned by the server. This method should only be called after the client has requested the resource. To enumerate all of the header fields returned by the server, use the GetFirstHeader and GetNextHeader methods.

See Also

HttpClient Class | SocketTools Namespace | AddHeaders Method | SetHeader Method