Closes#797Closes#798
JAXRSContract sets a single Content-Type value
This change allows headers to be cleared by passing a null
value for backwards compatibility.
Multiple Content-Type values are not valid because the body
that we send with any given request will only have a single
type.
Updated header entry assertion to be agnostic to header name
order.
* RequestTemplate.headers clear behavior matches that of query params
* Refactoring RequestTemplate to RFC6570
This change refactors `RequestTemplate` in an attempt to
adhere to the [RFC-6570 - URI Template](https://tools.ietf.org/html/rfc6570)
specification more closely. The reason for this is to
reduce the amount of inconsistency between `@Param`, `@QueryMap`,
`@Header`, `@HeaderMap`, and `@Body` template expansion.
First, `RequestTemplate` now delegates uri, header, query, and
body template parsing to `UriTemplate`, `HeaderTemplate`,
`QueryTemplate`, and `BodyTemplate` respectively. These components
are all variations on a `Template`.
`UriTemplate` adheres to RFC 6570 explicitly and supports Level 1
(Simple String) variable expansion. Unresolved variables are ignored
and removed from the uri. This includes query parameter pairs. All
literal and expanded variables are pct-encoded according to the Charset
provided in the `RequestTemplate`.
`HeaderTemplate` supports Level 1 (Simple String) variable expansion.
Unresolved variables are ignored. Empty headers are removed. No
encoding is performed.
`QueryTemplate` is a subset of a `UriTemplate` and reacts in the same
way. Unresolved pairs are ignored and not present on the final
template. All literals and expanded variables are pct-encoded
according to the Charset provided.
`BodyTemplate` supports Level 1 (Simple String) variable expansion.
Unresolved variables produce empty strings. Values are not encoded.
All remaining customizations, including custom encoders, collection format
expansion and charset encoding are still supportted and made backward
compatible.
Finally, a number of inconsistent methods on `RequestTemplate` have
been deprecated for public use and all deprecated usage throughout
the library has been replaced.
* The @Headers does not work
The @Headers does not work when it has space around ":".
Modify the method toMap() .
add trim() to the key and value
* corevert the field name whitespace changes
* add TestCase "headersContainsWhitespaces"
The decoded instance (from delegate.decode()) will be null when a
response body is null. This decoded instance (null) will result in a NPE
in the Optional since Optional.of is used. Changing this to
Optional.ofNullable will return an empty Optional when the decoded
instance is null.
* add charset to Response.Body when create Reader
* format
* support charset when build Reader for Response.Body
* support charset when build Reader for Response.Body
* support charset when build Reader for Response.Body
* format header
* format Response
Closes#719
This change adds the original Request Method to `RetryableException`,
allowing implementers to determine if a retry should occur based on
method and exception type.
To support this, `Response` objects now require that the original
`Request` be present. Test Cases, benchmarks, and documentation have
been added.
* Refactored Request Method Attribute on Requests
* Added `HttpMethod` enum that represents the supported HTTP methods
replacing String handling.
* Deprecated `Request#method()` in favor of `Request#httpMethod()`
* Creating headers from Request removing those with null or empty values
* Moving back to let the empty strings as valid header
* Returning headers filtering null and empty rather removing them for the current map. Supporting with tests as it needs to be LinkedHashMap not to lost the sorting
* Copy of feign-mock from git@github.com:velo/feign-mock.git
* Fix license headers, remove .tool files and make code java 6 compatible
* Remove all badges
* Update feign GitHub link
* Remove link to orignal project
* FIXED unsupported jaxrs-2.1 annotations should not break entire interface, resolving #669
* UPDATED jaxrs: more defensive jaxrs2 support
* ADDED jsr311-api dependency to httpclient (as jsr311 is `provided` in feign-jaxrs now)
* UPDATED httpclient `jsr311-api` scope to test
UPDATED jaxrs readme
Fixes#665
When verifying that any of th `@*Map` annotations are in fact
`Map` instances, we were assumping that all values are direct
extension of a `Map` with generic type information intact. When
using frameworks like Spring, it is possible to have `Map` objects
that do not expose type information, like `HttpHeaders`, which
directly extend from a `Map` with the type information static.
This added additional checking to the `checkMapKeys` function
to accomodate for `Map` subclasses without type information. If
the map key information cannot be validated, we simply pass it
through.
* Added support for custom param encoding
* Added ability to inherit @CustomParam annotation
* Updated class cast style to match rest of code
* Updated to use QueryMap for custom pojo query parameters
* Clarification in README of QueryMap POJO usage
* Removed unused line
* Updated custom POJO QueryMap test to prove that private fields can be used
* Removed no-longer-valid test endpoint
* Renamed tests to more accurately reflect their contents
* More test cleanup
* Modified QueryMap POJO encoding to use specified QueryMapEncoder (default implementation provided)
* Corrected typo in README.md
* Fixed merge conflict and typo in test name
* Allows different collection encodings
In the case where a parameter represents a collection of values, there are
conflicting ways of encoding that collection. Common ways are repeating the
parameter name (foo=bar&foo=baz) and using comma separated values (foo=bar,baz).
The current behavior repeats the parameter name. This change introduces an
additional RequestLine parameter that explicitly specifies the encoding type,
one of CSV, TSV, space-delimited, pipe-delimited, and repeating the parameter
name. The default value for this option is repeating the parameter name, so
backwards compatibility is maintained.
* Replace switch statement with enum method for joining values