From 3b08d9d6ae7218e4847ca94886716d845e4a35c5 Mon Sep 17 00:00:00 2001 From: NanaXiong00 <138103031+NanaXiong00@users.noreply.github.com> Date: Mon, 13 Jan 2025 13:58:42 +0800 Subject: [PATCH] add params --- .../java/com/azure/core/experimental/http/DynamicRequest.java | 1 + .../java/com/azure/core/experimental/http/DynamicResponse.java | 1 + .../experimental/http/DynamicRequestJavaDocCodeSnippets.java | 2 ++ .../experimental/http/DynamicResponseJavaDocCodeSnippets.java | 2 ++ 4 files changed, 6 insertions(+) diff --git a/sdk/core/azure-core-experimental/src/main/java/com/azure/core/experimental/http/DynamicRequest.java b/sdk/core/azure-core-experimental/src/main/java/com/azure/core/experimental/http/DynamicRequest.java index 3dbf8fe1abf6..724a1448582e 100644 --- a/sdk/core/azure-core-experimental/src/main/java/com/azure/core/experimental/http/DynamicRequest.java +++ b/sdk/core/azure-core-experimental/src/main/java/com/azure/core/experimental/http/DynamicRequest.java @@ -71,6 +71,7 @@ * DynamicResponse response = dynamicRequest * .setUrl("https://petstore.example.com/pet/{petId}") // may already be set if request is created from a client * .setPathParam("petId", "2343245") + * .setHttpMethod(HttpMethod.POST) * .send(); // makes the service call * * diff --git a/sdk/core/azure-core-experimental/src/main/java/com/azure/core/experimental/http/DynamicResponse.java b/sdk/core/azure-core-experimental/src/main/java/com/azure/core/experimental/http/DynamicResponse.java index f4341092d073..e22bbf02b84d 100644 --- a/sdk/core/azure-core-experimental/src/main/java/com/azure/core/experimental/http/DynamicResponse.java +++ b/sdk/core/azure-core-experimental/src/main/java/com/azure/core/experimental/http/DynamicResponse.java @@ -52,6 +52,7 @@ * DynamicResponse response = dynamicRequest * .setUrl("https://petstore.example.com/pet/{petId}") // may already be set if request is created from a client * .setPathParam("petId", "2343245") + * .setHttpMethod(HttpMethod.POST) * .send(); // makes the service call * * // Check the HTTP status diff --git a/sdk/core/azure-core-experimental/src/samples/java/com/azure/core/experimental/http/DynamicRequestJavaDocCodeSnippets.java b/sdk/core/azure-core-experimental/src/samples/java/com/azure/core/experimental/http/DynamicRequestJavaDocCodeSnippets.java index f00ee9832908..d92d8ef8fccc 100644 --- a/sdk/core/azure-core-experimental/src/samples/java/com/azure/core/experimental/http/DynamicRequestJavaDocCodeSnippets.java +++ b/sdk/core/azure-core-experimental/src/samples/java/com/azure/core/experimental/http/DynamicRequestJavaDocCodeSnippets.java @@ -4,6 +4,7 @@ package com.azure.core.experimental.http; import com.azure.core.http.HttpHeaderName; +import com.azure.core.http.HttpMethod; import com.azure.core.http.HttpPipeline; import com.azure.core.http.HttpPipelineBuilder; import com.azure.core.util.BinaryData; @@ -41,6 +42,7 @@ public void getRequestSample() { DynamicResponse response = dynamicRequest .setUrl("https://petstore.example.com/pet/{petId}") // may already be set if request is created from a client .setPathParam("petId", "2343245") + .setHttpMethod(HttpMethod.POST) .send(); // makes the service call // END: com.azure.core.experimental.http.dynamicrequest.getrequest } diff --git a/sdk/core/azure-core-experimental/src/samples/java/com/azure/core/experimental/http/DynamicResponseJavaDocCodeSnippets.java b/sdk/core/azure-core-experimental/src/samples/java/com/azure/core/experimental/http/DynamicResponseJavaDocCodeSnippets.java index 7247cb5dbaf5..45861798ca13 100644 --- a/sdk/core/azure-core-experimental/src/samples/java/com/azure/core/experimental/http/DynamicResponseJavaDocCodeSnippets.java +++ b/sdk/core/azure-core-experimental/src/samples/java/com/azure/core/experimental/http/DynamicResponseJavaDocCodeSnippets.java @@ -3,6 +3,7 @@ package com.azure.core.experimental.http; +import com.azure.core.http.HttpMethod; import com.azure.core.util.BinaryData; import com.azure.json.models.JsonArray; import com.azure.json.models.JsonNumber; @@ -24,6 +25,7 @@ public void readResponse() { DynamicResponse response = dynamicRequest .setUrl("https://petstore.example.com/pet/{petId}") // may already be set if request is created from a client .setPathParam("petId", "2343245") + .setHttpMethod(HttpMethod.POST) .send(); // makes the service call // Check the HTTP status