From 0e20e75752cb920aca4a754335e46e63abea31d7 Mon Sep 17 00:00:00 2001 From: tanghc Date: Wed, 12 May 2021 18:02:36 +0800 Subject: [PATCH] 4.4.0 --- .../com/gitee/sop/sdk/request/BaseRequest.java | 15 ++++++++------- .../src/test/java/com/gitee/sop/sdk/SdkTest.java | 2 ++ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/sop-sdk/sdk-java/src/main/java/com/gitee/sop/sdk/request/BaseRequest.java b/sop-sdk/sdk-java/src/main/java/com/gitee/sop/sdk/request/BaseRequest.java index 66a4e6ff..afe7ed69 100644 --- a/sop-sdk/sdk-java/src/main/java/com/gitee/sop/sdk/request/BaseRequest.java +++ b/sop-sdk/sdk-java/src/main/java/com/gitee/sop/sdk/request/BaseRequest.java @@ -44,6 +44,8 @@ public abstract class BaseRequest { private String bizContent = EMPTY_JSON; private Object bizModel; + private RequestMethod requestMethod = RequestMethod.POST; + /** * 上传文件 */ @@ -144,13 +146,12 @@ public abstract class BaseRequest { return responseClass; } - /** - * 指定HTTP请求method,默认POST - * - * @return - */ - protected RequestMethod getRequestMethod() { - return RequestMethod.POST; + + public RequestMethod getRequestMethod() { + return requestMethod; } + public void setRequestMethod(RequestMethod requestMethod) { + this.requestMethod = requestMethod; + } } diff --git a/sop-sdk/sdk-java/src/test/java/com/gitee/sop/sdk/SdkTest.java b/sop-sdk/sdk-java/src/test/java/com/gitee/sop/sdk/SdkTest.java index 8ba796a2..c2fc7d2c 100644 --- a/sop-sdk/sdk-java/src/test/java/com/gitee/sop/sdk/SdkTest.java +++ b/sop-sdk/sdk-java/src/test/java/com/gitee/sop/sdk/SdkTest.java @@ -3,6 +3,7 @@ package com.gitee.sop.sdk; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.gitee.sop.sdk.client.OpenClient; +import com.gitee.sop.sdk.common.RequestMethod; import com.gitee.sop.sdk.common.UploadFile; import com.gitee.sop.sdk.model.DemoFileUploadModel; import com.gitee.sop.sdk.model.GetStoryModel; @@ -65,6 +66,7 @@ public class SdkTest extends TestCase { Map bizModel = new HashMap<>(); bizModel.put("name", "白雪公主"); request.setBizModel(bizModel); +// request.setRequestMethod(RequestMethod.GET); // 发送请求 CommonResponse response = client.execute(request);