azure-docs-sdk-java/docs-ref-autogen/com.azure.core.annotation.H...

28 строки
3.6 KiB
YAML

### YamlMime:JavaType
uid: "com.azure.core.annotation.HeaderParam"
fullName: "com.azure.core.annotation.HeaderParam"
name: "HeaderParam"
nameWithType: "HeaderParam"
summary: "Replaces the header with the value of its target."
syntax: "public interface **HeaderParam**</br> implements <a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Annotation.html\">Annotation</a>"
methods:
- uid: "com.azure.core.annotation.HeaderParam.value()"
fullName: "com.azure.core.annotation.HeaderParam.value()"
name: "value()"
nameWithType: "HeaderParam.value()"
summary: "The name of the variable in the endpoint uri template which will be replaced with the value of the parameter annotated with this annotation."
modifiers:
- "abstract"
syntax: "public abstract String value()"
desc: "The name of the variable in the endpoint uri template which will be replaced with the value of the parameter annotated with this annotation."
returns:
description: "The name of the variable in the endpoint uri template which will be replaced with the value of the\n parameter annotated with this annotation."
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
type: "interface"
desc: "Replaces the header with the value of its target. The value specified here replaces headers specified statically in the <xref uid=\"com.azure.core.annotation.Headers\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Headers\"></xref>. If the parameter this annotation is attached to is a Map type, then this will be treated as a header collection. In that case each of the entries in the argument's map will be individual header values that use the value of this annotation as a prefix to their key/header name.\n\n**Example 1:**\n\n```java\n@Put(\"{functionId}\")\n Mono<ResponseBase<ResponseHeaders, ResponseBody>> createOrReplace(\n @PathParam(value = \"functionId\", encoded = true) String functionId,\n @BodyParam(\"application/json\") RequestBody function,\n @HeaderParam(\"If-Match\") String ifMatch);\n\n // \"If-Match: user passed value\" will show up as one of the headers.\n```\n\n**Example 2:**\n\n```java\n@Get(\"subscriptions/{subscriptionId}/providers/Microsoft.ServiceBus/namespaces\")\n Mono<ResponseBase<ResponseHeaders, ResponseBody>> list(@PathParam(\"subscriptionId\") String subscriptionId,\n @HeaderParam(\"accept-language\") String acceptLanguage,\n @HeaderParam(\"User-Agent\") String userAgent);\n\n // \"accept-language\" generated by the HTTP client will be overwritten by the user passed value.\n```\n\n**Example 3:**\n\n```java\n@Get(\"subscriptions/{subscriptionId}/providers/Microsoft.ServiceBus/namespaces\")\n Mono<ResponseBase<ResponseHeaders, ResponseBody>> list(@PathParam(\"subscriptionId\") String subscriptionId,\n @HeaderParam(\"Authorization\") String token);\n\n // The token parameter will replace the effect of any credentials in the HttpPipeline.\n```\n\n**Example 4:**\n\n```java\n@Put(\"{containerName}/{blob}\")\n @ExpectedResponses({200})\n Mono<ResponseBase<ResponseHeaders, Void>> setMetadata(@PathParam(\"containerName\") String containerName,\n @PathParam(\"blob\") String blob,\n @HeaderParam(\"x-ms-meta-\") Map<String, String> metadata);\n\n // The metadata parameter will be expanded out so that each entry becomes\n // \"x-ms-meta-{@literal <entryKey>}: {@literal <entryValue>}\".\n```"
implements:
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Annotation.html\">Annotation</a>"
metadata: {}
package: "com.azure.core.annotation"
artifact: com.azure:azure-core:1.54.0