iMES请求SAP添加请求头认证
This commit is contained in:
parent
3f5d450db0
commit
35a2e16a25
@ -26,12 +26,22 @@ public class SapUtil {
|
||||
private static final String sapUser = "RFC";
|
||||
private static final String sapPassword = "Admin@1234567890";
|
||||
|
||||
private static final JSONObject headJson;
|
||||
|
||||
static {
|
||||
headJson = new JSONObject();
|
||||
headJson.put("x-esb-apikey","hWS3L96a0h4NKCAjN9hG1OmOeEIsxCTz");
|
||||
headJson.put("x-esb-env","DEV");
|
||||
}
|
||||
|
||||
|
||||
public static String appendHead(String jsonStr) {
|
||||
JSONObject allJson = new JSONObject();
|
||||
allJson.put("API_METHOD", "POST");
|
||||
JSONObject json = JSONObject.parseObject(jsonStr);
|
||||
allJson.put("API_DATA", json);
|
||||
allJson.put("API_PATH", sapUrl);
|
||||
allJson.put("headers", headJson);
|
||||
return allJson.toJSONString();
|
||||
}
|
||||
|
||||
@ -40,6 +50,7 @@ public class SapUtil {
|
||||
allJson.put("API_METHOD", "POST");
|
||||
allJson.put("API_DATA", jsonObj);
|
||||
allJson.put("API_PATH", sapUrl);
|
||||
allJson.put("headers", headJson);
|
||||
return allJson;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user