mirror of
https://gitee.com/durcframework/SOP.git
synced 2025-08-11 21:57:56 +08:00
4.4.0
This commit is contained in:
@@ -44,6 +44,8 @@ public abstract class BaseRequest<T extends BaseResponse> {
|
|||||||
private String bizContent = EMPTY_JSON;
|
private String bizContent = EMPTY_JSON;
|
||||||
private Object bizModel;
|
private Object bizModel;
|
||||||
|
|
||||||
|
private RequestMethod requestMethod = RequestMethod.POST;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 上传文件
|
* 上传文件
|
||||||
*/
|
*/
|
||||||
@@ -144,13 +146,12 @@ public abstract class BaseRequest<T extends BaseResponse> {
|
|||||||
return responseClass;
|
return responseClass;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 指定HTTP请求method,默认POST
|
public RequestMethod getRequestMethod() {
|
||||||
*
|
return requestMethod;
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
protected RequestMethod getRequestMethod() {
|
|
||||||
return RequestMethod.POST;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setRequestMethod(RequestMethod requestMethod) {
|
||||||
|
this.requestMethod = requestMethod;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -3,6 +3,7 @@ package com.gitee.sop.sdk;
|
|||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.gitee.sop.sdk.client.OpenClient;
|
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.common.UploadFile;
|
||||||
import com.gitee.sop.sdk.model.DemoFileUploadModel;
|
import com.gitee.sop.sdk.model.DemoFileUploadModel;
|
||||||
import com.gitee.sop.sdk.model.GetStoryModel;
|
import com.gitee.sop.sdk.model.GetStoryModel;
|
||||||
@@ -65,6 +66,7 @@ public class SdkTest extends TestCase {
|
|||||||
Map<String, Object> bizModel = new HashMap<>();
|
Map<String, Object> bizModel = new HashMap<>();
|
||||||
bizModel.put("name", "白雪公主");
|
bizModel.put("name", "白雪公主");
|
||||||
request.setBizModel(bizModel);
|
request.setBizModel(bizModel);
|
||||||
|
// request.setRequestMethod(RequestMethod.GET);
|
||||||
|
|
||||||
// 发送请求
|
// 发送请求
|
||||||
CommonResponse response = client.execute(request);
|
CommonResponse response = client.execute(request);
|
||||||
|
Reference in New Issue
Block a user