Class HeaderUtils
A utility class that processes values for HTTP headers.
Inherited Members
Namespace: Oci.Common.Http.Internal
Assembly: OCI.DotNetSDK.Common.dll
Syntax
public class HeaderUtils
Methods
FromValue(dynamic)
Returns string representation of a header value from various types.
Declaration
public static string FromValue(dynamic value)
Parameters
| Type | Name | Description |
|---|---|---|
| dynamic | value | The header value. |
Returns
| Type | Description |
|---|---|
| string | The string representation of the header value. |
GetFirstorDefaultHeaderValue(HttpResponseHeaders, string)
Retrieves the first header value that matches the give header name.
Declaration
public static string GetFirstorDefaultHeaderValue(HttpResponseHeaders headers, string headerName)
Parameters
| Type | Name | Description |
|---|---|---|
| HttpResponseHeaders | headers | The HttpResponseHeaders to search from. |
| string | headerName | The header name to search for. |
Returns
| Type | Description |
|---|---|
| string | The first matching header's value if found; or empty string if not found. |
ToValue(string, Type)
Converts a string into header value based on the type provided.
Declaration
public static dynamic ToValue(string strValue, Type type)
Parameters
| Type | Name | Description |
|---|---|---|
| string | strValue | The string representation of the header value. |
| Type | type | The expected type of the header value. |
Returns
| Type | Description |
|---|---|
| dynamic | The converted header value. |