Skip to content

libcURL.ResponseHeaderEngine

Andrew Lambert edited this page Nov 26, 2022 · 10 revisions

libcURL.ResponseHeaderEngine

Class Declaration

 Protected Class ResponseHeaderEngine

Remarks

This class presents an interface to libcURL's response headers API (the "response header engine"). Each instance of EasyHandle has its own response header engine. Use this class to query the response headers from the most recent transfer.

A given header name may be used more than once. If more than one instance of a name is present then you may refer to them individually by specifying their index when querying the response headers. You can determine how many headers are using a name by passing the name to the Count() method.

Response headers may originate from several different stages in an HTTP(S) operation depending on circumstances such as proxying, HTTP version, redirection, etc. When querying the response headers you may restrict the query only to headers of a certain origin by specifying a member of the HeaderOriginType enumeration.

A single transfer might consist of a series of HTTP responses, for example redirects or multi-stage authentication. You can specify the response index when querying the response headers. 0 being the first response, 1 being the next, and so on. -1 refers to the most recent response in the series.

Generally, you should not create your own instances of this class. Instead use the ResponseHeaderEngine reference belonging to the EasyHandle whose response headers you want to query.

Example

 Dim c As New cURLClient
 If c.Get("https://www.example.com/") Then
   ' get single header
   Dim header As libcURL.ResponseHeader = c.ResponseHeaders.GetHeader("Content-Type") 

   ' get multiple headers
   Dim headers() As libcURL.ResponseHeader = c.ResponseHeaders.GetHeaders("", libcURL.HeaderOriginType.Header)
 End If

Methods

See also

Clone this wiki locally