/
com.azure.core.http.policy.AddHeadersFromContextPolicy.yml
81 lines (81 loc) · 8.6 KB
/
com.azure.core.http.policy.AddHeadersFromContextPolicy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
### YamlMime:JavaType
uid: "com.azure.core.http.policy.AddHeadersFromContextPolicy"
fullName: "com.azure.core.http.policy.AddHeadersFromContextPolicy"
name: "AddHeadersFromContextPolicy"
nameWithType: "AddHeadersFromContextPolicy"
summary: "The pipeline policy that override or add <xref uid=\"com.azure.core.http.HttpHeaders\" data-throw-if-not-resolved=\"false\" data-raw-source=\"HttpHeaders\"></xref> in <xref uid=\"com.azure.core.http.HttpRequest\" data-throw-if-not-resolved=\"false\" data-raw-source=\"HttpRequest\"></xref> by reading values from <xref uid=\"com.azure.core.util.Context\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Context\"></xref> with key 'azure-http-headers-key'."
inheritances:
- "<xref href=\"java.lang.Object?displayProperty=fullName\" data-throw-if-not-resolved=\"False\" />"
inheritedClassMethods:
- classRef: "java.lang.<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html\">Object</a>"
methodsRef:
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone--\">clone</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-\">equals</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--\">finalize</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--\">getClass</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--\">hashCode</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--\">notify</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--\">notifyAll</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--\">toString</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--\">wait</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-\">wait</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-\">wait</a>"
syntax: "public class **AddHeadersFromContextPolicy**</br> implements <xref href=\"com.azure.core.http.policy.HttpPipelinePolicy?alt=com.azure.core.http.policy.HttpPipelinePolicy&text=HttpPipelinePolicy\" data-throw-if-not-resolved=\"False\" />"
constructors:
- uid: "com.azure.core.http.policy.AddHeadersFromContextPolicy.AddHeadersFromContextPolicy()"
fullName: "com.azure.core.http.policy.AddHeadersFromContextPolicy.AddHeadersFromContextPolicy()"
name: "AddHeadersFromContextPolicy()"
nameWithType: "AddHeadersFromContextPolicy.AddHeadersFromContextPolicy()"
summary: "Creates a new instance of <xref uid=\"com.azure.core.http.policy.AddHeadersFromContextPolicy\" data-throw-if-not-resolved=\"false\" data-raw-source=\"AddHeadersFromContextPolicy\"></xref>."
syntax: "public AddHeadersFromContextPolicy()"
desc: "Creates a new instance of <xref uid=\"com.azure.core.http.policy.AddHeadersFromContextPolicy\" data-throw-if-not-resolved=\"false\" data-raw-source=\"AddHeadersFromContextPolicy\"></xref>."
fields:
- uid: "com.azure.core.http.policy.AddHeadersFromContextPolicy.AZURE_REQUEST_HTTP_HEADERS_KEY"
fullName: "com.azure.core.http.policy.AddHeadersFromContextPolicy.AZURE_REQUEST_HTTP_HEADERS_KEY"
name: "AZURE_REQUEST_HTTP_HEADERS_KEY"
nameWithType: "AddHeadersFromContextPolicy.AZURE_REQUEST_HTTP_HEADERS_KEY"
summary: "Key used to override headers in Http<wbr>Request."
modifiers:
- "static"
- "final"
field:
value: "azure-http-headers-key"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
syntax: "public static final String AZURE_REQUEST_HTTP_HEADERS_KEY"
desc: "Key used to override headers in HttpRequest. The Value for this key should be <xref uid=\"com.azure.core.http.HttpHeaders\" data-throw-if-not-resolved=\"false\" data-raw-source=\"HttpHeaders\"></xref>."
methods:
- uid: "com.azure.core.http.policy.AddHeadersFromContextPolicy.process(com.azure.core.http.HttpPipelineCallContext,com.azure.core.http.HttpPipelineNextPolicy)"
fullName: "com.azure.core.http.policy.AddHeadersFromContextPolicy.process(HttpPipelineCallContext context, HttpPipelineNextPolicy next)"
name: "process(HttpPipelineCallContext context, HttpPipelineNextPolicy next)"
nameWithType: "AddHeadersFromContextPolicy.process(HttpPipelineCallContext context, HttpPipelineNextPolicy next)"
summary: "Processes provided request context and invokes the next policy."
parameters:
- name: "context"
type: "<xref href=\"com.azure.core.http.HttpPipelineCallContext?alt=com.azure.core.http.HttpPipelineCallContext&text=HttpPipelineCallContext\" data-throw-if-not-resolved=\"False\" />"
- name: "next"
type: "<xref href=\"com.azure.core.http.HttpPipelineNextPolicy?alt=com.azure.core.http.HttpPipelineNextPolicy&text=HttpPipelineNextPolicy\" data-throw-if-not-resolved=\"False\" />"
syntax: "public Mono<HttpResponse> process(HttpPipelineCallContext context, HttpPipelineNextPolicy next)"
desc: "Processes provided request context and invokes the next policy."
returns:
type: "<a href=\"https://projectreactor.io/docs/core/release/api/reactor/core/publisher/Mono.html\">Mono</a><<xref href=\"com.azure.core.http.HttpResponse?alt=com.azure.core.http.HttpResponse&text=HttpResponse\" data-throw-if-not-resolved=\"False\" />>"
- uid: "com.azure.core.http.policy.AddHeadersFromContextPolicy.processSync(com.azure.core.http.HttpPipelineCallContext,com.azure.core.http.HttpPipelineNextSyncPolicy)"
fullName: "com.azure.core.http.policy.AddHeadersFromContextPolicy.processSync(HttpPipelineCallContext context, HttpPipelineNextSyncPolicy next)"
name: "processSync(HttpPipelineCallContext context, HttpPipelineNextSyncPolicy next)"
nameWithType: "AddHeadersFromContextPolicy.processSync(HttpPipelineCallContext context, HttpPipelineNextSyncPolicy next)"
summary: "Processes provided request context and invokes the next policy synchronously."
parameters:
- name: "context"
type: "<xref href=\"com.azure.core.http.HttpPipelineCallContext?alt=com.azure.core.http.HttpPipelineCallContext&text=HttpPipelineCallContext\" data-throw-if-not-resolved=\"False\" />"
- name: "next"
type: "<xref href=\"com.azure.core.http.HttpPipelineNextSyncPolicy?alt=com.azure.core.http.HttpPipelineNextSyncPolicy&text=HttpPipelineNextSyncPolicy\" data-throw-if-not-resolved=\"False\" />"
syntax: "public HttpResponse processSync(HttpPipelineCallContext context, HttpPipelineNextSyncPolicy next)"
desc: "Processes provided request context and invokes the next policy synchronously."
returns:
type: "<xref href=\"com.azure.core.http.HttpResponse?alt=com.azure.core.http.HttpResponse&text=HttpResponse\" data-throw-if-not-resolved=\"False\" />"
type: "class"
desc: "The pipeline policy that override or add <xref uid=\"com.azure.core.http.HttpHeaders\" data-throw-if-not-resolved=\"false\" data-raw-source=\"HttpHeaders\"></xref> in <xref uid=\"com.azure.core.http.HttpRequest\" data-throw-if-not-resolved=\"false\" data-raw-source=\"HttpRequest\"></xref> by reading values from <xref uid=\"com.azure.core.util.Context\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Context\"></xref> with key 'azure-http-headers-key'. The value for this key should be of type <xref uid=\"com.azure.core.http.HttpHeaders\" data-throw-if-not-resolved=\"false\" data-raw-source=\"HttpHeaders\"></xref> for it to be added in <xref uid=\"com.azure.core.http.HttpRequest\" data-throw-if-not-resolved=\"false\" data-raw-source=\"HttpRequest\"></xref>.\n\n**Code Sample: Add multiple HttpHeader in Context and call client**\n\n```java\n// Create ConfigurationClient for example\n ConfigurationClient configurationClient = new ConfigurationClientBuilder()\n .connectionString(\"endpoint={endpoint_value};id={id_value};secret={secret_value}\")\n .buildClient();\n // Add your headers\n HttpHeaders headers = new HttpHeaders();\n headers.put(\"my-header1\", \"my-header1-value\");\n headers.put(\"my-header2\", \"my-header2-value\");\n headers.put(\"my-header3\", \"my-header3-value\");\n // Call API by passing headers in Context.\n configurationClient.addConfigurationSettingWithResponse(\n new ConfigurationSetting().setKey(\"key\").setValue(\"value\"),\n new Context(AddHeadersFromContextPolicy.AZURE_REQUEST_HTTP_HEADERS_KEY, headers));\n // Above three HttpHeader will be added in outgoing HttpRequest.\n```"
implements:
- "<xref href=\"com.azure.core.http.policy.HttpPipelinePolicy?alt=com.azure.core.http.policy.HttpPipelinePolicy&text=HttpPipelinePolicy\" data-throw-if-not-resolved=\"False\" />"
metadata: {}
package: "com.azure.core.http.policy"
artifact: com.azure:azure-core:1.49.0