标签:web nts scheme style json color turn word password
@Component @Configuration public class GateWayFilter implements GlobalFilter, Ordered { @Override public Mono<Void> filter(ServerWebExchange exchange, GatewayFilterChain chain) { ServerHttpRequest request = exchange.getRequest(); ServerHttpResponse response = exchange.getResponse(); System.out.println("request: " + JSONUtil.toJsonStr(request)); //-------- uri ---------- URI uri = request.getURI(); System.out.println("uri: " + JSONUtil.toJsonStr(uri)); String path = uri.getPath(); String scheme = uri.getScheme(); int port = uri.getPort(); String authority = uri.getAuthority(); String query = uri.getQuery(); String host = uri.getHost(); String schemeSpecificPart = uri.getSchemeSpecificPart(); // ----------- body ------------ Flux<DataBuffer> body = request.getBody(); // ----------- query ------------ System.out.println(); MultiValueMap<String, String> queryParams = request.getQueryParams(); Set<String> keys = queryParams.keySet(); for (String key : keys) { System.out.print(" key:" + key + " value:" + queryParams.getFirst(key)); } System.out.println(); HttpHeaders headers = request.getHeaders(); //uri: {"path":"/payment/get/1","scheme":"http","port":9527,"authority":"localhost:9527","query":"realName=draymond&password=123456","host":"localhost","schemeSpecificPart":"//localhost:9527/payment/get/1?realName=draymond&password=123456"} return chain.filter(exchange); }
请求参数 url信息
body信息
head信息
标签:web nts scheme style json color turn word password
原文地址:https://www.cnblogs.com/draymond/p/12793894.html