{"action":"created","issue":{"url":"https://api.github.com/repos/Netflix/feign/issues/301","repository_url":"https://api.github.com/repos/Netflix/feign","labels_url":"https://api.github.com/repos/Netflix/feign/issues/301/labels{/name}","comments_url":"https://api.github.com/repos/Netflix/feign/issues/301/comments","events_url":"https://api.github.com/repos/Netflix/feign/issues/301/events","html_url":"https://github.com/Netflix/feign/issues/301","id":121000094,"number":301,"title":"Awkward error when header parameter isn't at index 0","user":{"login":"adriancole","id":64215,"avatar_url":"https://avatars.githubusercontent.com/u/64215?v=3","gravatar_id":"","url":"https://api.github.com/users/adriancole","html_url":"https://github.com/adriancole","followers_url":"https://api.github.com/users/adriancole/followers","following_url":"https://api.github.com/users/adriancole/following{/other_user}","gists_url":"https://api.github.com/users/adriancole/gists{/gist_id}","starred_url":"https://api.github.com/users/adriancole/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adriancole/subscriptions","organizations_url":"https://api.github.com/users/adriancole/orgs","repos_url":"https://api.github.com/users/adriancole/repos","events_url":"https://api.github.com/users/adriancole/events{/privacy}","received_events_url":"https://api.github.com/users/adriancole/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-12-08T12:51:19Z","updated_at":"2016-05-11T10:01:27Z","closed_at":"2016-05-11T10:01:27Z","body":"There's a pretty awkward error when someone attempts to do Bearer token directly.\r\n\r\nGiven\r\n```java\r\n@RequestLine(\"GET /me/tracks?offset={offset}&limit={limit}\")\r\n@Headers(\"Authorization: Bearer {access_token}\")\r\nList<Track> tracks(@Param(\"access_token\") String accessToken, @Param(\"offset\") Integer offset, @Param(\"limit\") Integer limit);\r\n```\r\n\r\nWe throw this:\r\n```\r\nfeign.codec.EncodeException: class java.util.LinkedHashMap is not a type supported by this encoder.\r\n\r\n    at feign.codec.Encoder$Default.encode(Encoder.java:84)\r\n    at feign.ReflectiveFeign$BuildFormEncodedTemplateFromArgs.resolve(ReflectiveFeign.java:227)\r\n    at feign.ReflectiveFeign$BuildTemplateByResolvingArgs.create(ReflectiveFeign.java:199)\r\n    at feign.SynchronousMethodHandler.invoke(SynchronousMethodHandler.java:70)\r\n    at feign.ReflectiveFeign$FeignInvocationHandler.invoke(ReflectiveFeign.java:94)\r\n    at com.sun.proxy.$Proxy97.tracks(Unknown Source)\r\n```\r\n\r\nWe could do a better job in the associated logic, ex. throw an error instead of assuming it is a form. Ex. in above it is a GET, so we could harden this logic: https://github.com/Netflix/feign/blob/v8.12.1/core/src/main/java/feign/Contract.java#L246\r\n\r\nThanks to @backfx for reporting\r\n\r\nSee #288 on oauth and the more general issue "},"comment":{"url":"https://api.github.com/repos/Netflix/feign/issues/comments/218415598","html_url":"https://github.com/Netflix/feign/issues/301#issuecomment-218415598","issue_url":"https://api.github.com/repos/Netflix/feign/issues/301","id":218415598,"user":{"login":"adriancole","id":64215,"avatar_url":"https://avatars.githubusercontent.com/u/64215?v=3","gravatar_id":"","url":"https://api.github.com/users/adriancole","html_url":"https://github.com/adriancole","followers_url":"https://api.github.com/users/adriancole/followers","following_url":"https://api.github.com/users/adriancole/following{/other_user}","gists_url":"https://api.github.com/users/adriancole/gists{/gist_id}","starred_url":"https://api.github.com/users/adriancole/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adriancole/subscriptions","organizations_url":"https://api.github.com/users/adriancole/orgs","repos_url":"https://api.github.com/users/adriancole/repos","events_url":"https://api.github.com/users/adriancole/events{/privacy}","received_events_url":"https://api.github.com/users/adriancole/received_events","type":"User","site_admin":false},"created_at":"2016-05-11T10:01:27Z","updated_at":"2016-05-11T10:01:27Z","body":"This should already work, as the code's been merged here https://github.com/Netflix/feign/pull/326/files#diff-ce1202871042b955135cdebcd2233cd4R377"}}