@Override public void applyTo(HTTPRequest httpRequest) throws SerializeException { if (httpRequest.getMethod() != HTTPRequest.Method.POST) throw new SerializeException("The HTTP request method must be POST"); ContentType ct = httpRequest.getContentType(); if (ct == null) throw new SerializeException("Missing HTTP Content-Type header"); if (!ct.match(CommonContentTypes.APPLICATION_URLENCODED)) throw new SerializeException( "The HTTP Content-Type header must be " + CommonContentTypes.APPLICATION_URLENCODED); Map<String, String> params = httpRequest.getQueryParameters(); params.putAll(toParameters()); String queryString = URLUtils.serializeParameters(params); httpRequest.setQuery(queryString); }
@Override public void applyTo(HTTPRequest httpRequest) throws SerializeException { if (httpRequest.getMethod() != HTTPRequest.Method.POST) throw new SerializeException("The HTTP request method must be POST"); ContentType ct = httpRequest.getContentType(); if (ct == null) throw new SerializeException("Missing HTTP Content-Type header"); if (!ct.match(CommonContentTypes.APPLICATION_URLENCODED)) throw new SerializeException( "The HTTP Content-Type header must be " + CommonContentTypes.APPLICATION_URLENCODED); Map<String, String> params = httpRequest.getQueryParameters(); params.putAll(toParameters()); String queryString = URLUtils.serializeParameters(params); httpRequest.setQuery(queryString); }
@Override public void applyTo(HTTPRequest httpRequest) throws SerializeException { if (httpRequest.getMethod() != HTTPRequest.Method.POST) throw new SerializeException("The HTTP request method must be POST"); ContentType ct = httpRequest.getContentType(); if (ct == null) throw new SerializeException("Missing HTTP Content-Type header"); if (!ct.match(CommonContentTypes.APPLICATION_URLENCODED)) throw new SerializeException( "The HTTP Content-Type header must be " + CommonContentTypes.APPLICATION_URLENCODED); Map<String, String> params = httpRequest.getQueryParameters(); params.putAll(toParameters()); String queryString = URLUtils.serializeParameters(params); httpRequest.setQuery(queryString); }