@Test public void formParametersAreDeserialized() { final FormUrlEncodedHttpDeserializer deserializer = FormUrlEncodedHttpDeserializer.UTF8; final HttpHeaders headers = DefaultHttpHeadersFactory.INSTANCE.newHeaders(); headers.set(CONTENT_TYPE, "application/x-www-form-urlencoded; charset=UTF-8"); final String formParameters = "escape%26this%3D=and%26this%25&param2=bar&param2=foo&emptyParam="; final Map<String, List<String>> deserialized = deserializer.deserialize(headers, toBuffer(formParameters)); assertEquals("Unexpected parameter value.", singletonList("and&this%"), deserialized.get("escape&this=")); assertEquals("Unexpected parameter value count.", 2, deserialized.get("param2").size()); assertEquals("Unexpected parameter value.", "bar", deserialized.get("param2").get(0)); assertEquals("Unexpected parameter value.", "foo", deserialized.get("param2").get(1)); assertEquals("Unexpected parameter value count.", 1, deserialized.get("emptyParam").size()); assertEquals("Unexpected parameter value.", "", deserialized.get("emptyParam").get(0)); }
@Override public Map<String, List<String>> deserialize(final HttpHeaders headers, final Buffer payload) { checkContentType(headers, checkContentType); return deserialize(payload); }
FormUrlEncodedHttpDeserializer implements HttpDeserializer<Map<String, List<String>>> { @Override public Map<String, List<String>> deserialize(final HttpHeaders headers, final Buffer payload) { checkContentType(headers, checkContentType); return deserialize(payload); } }
FormUrlEncodedHttpDeserializer implements HttpDeserializer<Map<String, List<String>>> { @Override public Map<String, List<String>> deserialize(final HttpHeaders headers, final Buffer payload) { checkContentType(headers, checkContentType); return deserialize(payload); } FormUrlEncodedHttpDeserializer(final Charset charset, final Predicate<HttpHeaders> checkContentType); }
FormUrlEncodedHttpDeserializer implements HttpDeserializer<Map<String, List<String>>> { @Override public Map<String, List<String>> deserialize(final HttpHeaders headers, final Buffer payload) { checkContentType(headers, checkContentType); return deserialize(payload); } FormUrlEncodedHttpDeserializer(final Charset charset, final Predicate<HttpHeaders> checkContentType); @Override Map<String, List<String>> deserialize(final HttpHeaders headers, final Buffer payload); @Override BlockingIterable<Map<String, List<String>>> deserialize(final HttpHeaders headers,
                                                                   final BlockingIterable<Buffer> payload); @Override Publisher<Map<String, List<String>>> deserialize(final HttpHeaders headers,
                                                            final Publisher<Buffer> payload); }
FormUrlEncodedHttpDeserializer implements HttpDeserializer<Map<String, List<String>>> { @Override public Map<String, List<String>> deserialize(final HttpHeaders headers, final Buffer payload) { checkContentType(headers, checkContentType); return deserialize(payload); } FormUrlEncodedHttpDeserializer(final Charset charset, final Predicate<HttpHeaders> checkContentType); @Override Map<String, List<String>> deserialize(final HttpHeaders headers, final Buffer payload); @Override BlockingIterable<Map<String, List<String>>> deserialize(final HttpHeaders headers,
                                                                   final BlockingIterable<Buffer> payload); @Override Publisher<Map<String, List<String>>> deserialize(final HttpHeaders headers,
                                                            final Publisher<Buffer> payload);  }