Package com.azure.core.annotation
Annotation Type BodyParam
Annotation to annotate a parameter to send to a REST endpoint as HTTP Request content.
If the parameter type extends InputStream, this payload is streamed to server through
"application/octet-stream". Otherwise, the body is serialized first and sent as "application/json" or
"application/xml", based on the serializer.
Example 1: Put JSON
@Put("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/"
+ "virtualMachines/{vmName}")
VirtualMachine createOrUpdate(@PathParam("resourceGroupName") String rgName,
@PathParam("vmName") String vmName,
@PathParam("subscriptionId") String subscriptionId,
@BodyParam("application/json") VirtualMachine vm);
Example 2: Stream
@Post("formdata/stream/uploadfile")
void uploadFileViaBody(@BodyParam("application/octet-stream") FileInputStream fileContent);
-
Required Element Summary
Required Elements
-
Element Details
-
value
String valueGets the Content-Type for the body.- Returns:
- The Content-Type for the body.
-