GitHub Viewer
import com.drops.utils.StringRandom;
/**
* @ClassName: gateway
* @Description: TODO
* @Author: Summer
* @Date: 2022/4/17 19:46
* @Version: v1.0.0
* @Description:
**/
public class gateway {
public static void main(String[] args) {
String endpoint = "s" + StringRandom.getRandomString(5);
String body = String.format("{\n" +
" \"id\": \"%s\",\n" +
" \"filters\": [{\n" +
" \"name\": \"AddResponseHeader\",\n" +
" \"args\": {\"name\": \"Result\",\"value\": \"%s\"}\n" +
" }],\n" +
" \"uri\": \"http://example.com\",\n" +
" \"order\": 0\n" +
"}", endpoint, endpoint);
System.out.println(body);
String res = "Response Headers: \n" +
" null=[HTTP/1.1 200 OK]\n" +
" Content-Length=[7]\n" +
" Content-Type=[text/html;charset=UTF-8]\n" +
"Response Body: \n" +
" s0gjvh";
System.out.println(res.contains("s0gjvh"));
}
}