Giving an URL connection established through the function http.connection returns the value of a field on the header indicated through the attribute name.
1 http.connection.getHeaderField
<http.connection.getHeaderField name='name'>
<http_connection /> !
</http.connection.getHeaderField>
Attributes | |||||
---|---|---|---|---|---|
Name | Type | Required | Default | Description | |
Aname | string | Name of the field on the header. |
Arguments | |||||
---|---|---|---|---|---|
Name | Type | Required | Unique | Nullable | Description |
Ehttp_connection | HttpURLConnectionWrapper | URL connection established to a web address. |
Returns | |
---|---|
Type | Description |
string | Returns the value of the field on the header indicated in the established URL connection. |
Example
Obtain the value of the field on the header of an URL connection. The function http.connection returns an URL connection, and with http.conection.getHeaderField the value of the field Set-Cookie is read. The function println shows the content by console.
Copy
<xsql-script name='http_connection_ghf'> <body> <set name='m_cookie'> <http.connection.getHeaderField name='Set-Cookie'> <http.connection url='http://www.google.es' /> </http.connection.getHeaderField> </set> <println><m_cookie /></println> </body> </xsql-script>