@Test void appendRequestQuery() throws URISyntaxException { Request request = new Request(); request.uri = new URI("http: Form f = new Form(); f.add("foo", "bar"); f.appendRequestQuery(request); f.fromRequestQuery(request); assertThat(f.get("x").get(0)).isEqualTo("="); assertThat(f.get("y").get(0)).isEqualTo("?"); assertThat(f.get("z").get(0)).isEqualTo("a"); assertThat(f.get("foo").get(0)).isEqualTo("bar"); assertThat(request.uri.toString()).isEqualTo("http: }
public void appendRequestQuery(Request request) { StringBuilder sb = new StringBuilder(); String uriQuery = request.uri.getRawQuery(); if (uriQuery != null && uriQuery.length() > 0) { sb.append(uriQuery); } String toAppend = toString(); if (toAppend != null && toAppend.length() > 0) { if (sb.length() > 0) { sb.append('&'); } sb.append(toAppend); } String newQuery = sb.toString(); if (newQuery.length() == 0) { newQuery = null; } try { request.uri = URIUtil.create(request.uri.getScheme(), request.uri.getRawUserInfo(), request.uri.getHost(), request.uri.getPort(), request.uri.getRawPath(), newQuery, request.uri.getRawFragment()); } catch (URISyntaxException use) { throw new IllegalArgumentException(use); } }
Form extends MultiValueMap<String, String> { public void appendRequestQuery(Request request) { StringBuilder sb = new StringBuilder(); String uriQuery = request.uri.getRawQuery(); if (uriQuery != null && uriQuery.length() > 0) { sb.append(uriQuery); } String toAppend = toString(); if (toAppend != null && toAppend.length() > 0) { if (sb.length() > 0) { sb.append('&'); } sb.append(toAppend); } String newQuery = sb.toString(); if (newQuery.length() == 0) { newQuery = null; } try { request.uri = URIUtil.create(request.uri.getScheme(), request.uri.getRawUserInfo(), request.uri.getHost(), request.uri.getPort(), request.uri.getRawPath(), newQuery, request.uri.getRawFragment()); } catch (URISyntaxException use) { throw new IllegalArgumentException(use); } } }
Form extends MultiValueMap<String, String> { public void appendRequestQuery(Request request) { StringBuilder sb = new StringBuilder(); String uriQuery = request.uri.getRawQuery(); if (uriQuery != null && uriQuery.length() > 0) { sb.append(uriQuery); } String toAppend = toString(); if (toAppend != null && toAppend.length() > 0) { if (sb.length() > 0) { sb.append('&'); } sb.append(toAppend); } String newQuery = sb.toString(); if (newQuery.length() == 0) { newQuery = null; } try { request.uri = URIUtil.create(request.uri.getScheme(), request.uri.getRawUserInfo(), request.uri.getHost(), request.uri.getPort(), request.uri.getRawPath(), newQuery, request.uri.getRawFragment()); } catch (URISyntaxException use) { throw new IllegalArgumentException(use); } } Form(); }
Form extends MultiValueMap<String, String> { public void appendRequestQuery(Request request) { StringBuilder sb = new StringBuilder(); String uriQuery = request.uri.getRawQuery(); if (uriQuery != null && uriQuery.length() > 0) { sb.append(uriQuery); } String toAppend = toString(); if (toAppend != null && toAppend.length() > 0) { if (sb.length() > 0) { sb.append('&'); } sb.append(toAppend); } String newQuery = sb.toString(); if (newQuery.length() == 0) { newQuery = null; } try { request.uri = URIUtil.create(request.uri.getScheme(), request.uri.getRawUserInfo(), request.uri.getHost(), request.uri.getPort(), request.uri.getRawPath(), newQuery, request.uri.getRawFragment()); } catch (URISyntaxException use) { throw new IllegalArgumentException(use); } } Form(); Form fromString(String s); @Override String toString(); Form fromRequestQuery(Request request); void toRequestQuery(Request request); void appendRequestQuery(Request request); Form fromRequestEntity(Request request); void toRequestEntity(Request request); }
Form extends MultiValueMap<String, String> { public void appendRequestQuery(Request request) { StringBuilder sb = new StringBuilder(); String uriQuery = request.uri.getRawQuery(); if (uriQuery != null && uriQuery.length() > 0) { sb.append(uriQuery); } String toAppend = toString(); if (toAppend != null && toAppend.length() > 0) { if (sb.length() > 0) { sb.append('&'); } sb.append(toAppend); } String newQuery = sb.toString(); if (newQuery.length() == 0) { newQuery = null; } try { request.uri = URIUtil.create(request.uri.getScheme(), request.uri.getRawUserInfo(), request.uri.getHost(), request.uri.getPort(), request.uri.getRawPath(), newQuery, request.uri.getRawFragment()); } catch (URISyntaxException use) { throw new IllegalArgumentException(use); } } Form(); Form fromString(String s); @Override String toString(); Form fromRequestQuery(Request request); void toRequestQuery(Request request); void appendRequestQuery(Request request); Form fromRequestEntity(Request request); void toRequestEntity(Request request);  }