{"action":"created","issue":{"url":"https://api.github.com/repos/xeqi/peridot/issues/22","labels_url":"https://api.github.com/repos/xeqi/peridot/issues/22/labels{/name}","comments_url":"https://api.github.com/repos/xeqi/peridot/issues/22/comments","events_url":"https://api.github.com/repos/xeqi/peridot/issues/22/events","html_url":"https://github.com/xeqi/peridot/issues/22","id":70398198,"number":22,"title":"POST requests that aren't x-www-form-urlencoded?","user":{"login":"magnars","id":265785,"avatar_url":"https://avatars.githubusercontent.com/u/265785?v=3","gravatar_id":"","url":"https://api.github.com/users/magnars","html_url":"https://github.com/magnars","followers_url":"https://api.github.com/users/magnars/followers","following_url":"https://api.github.com/users/magnars/following{/other_user}","gists_url":"https://api.github.com/users/magnars/gists{/gist_id}","starred_url":"https://api.github.com/users/magnars/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/magnars/subscriptions","organizations_url":"https://api.github.com/users/magnars/orgs","repos_url":"https://api.github.com/users/magnars/repos","events_url":"https://api.github.com/users/magnars/events{/privacy}","received_events_url":"https://api.github.com/users/magnars/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-04-23T12:20:50Z","updated_at":"2015-08-14T21:39:36Z","closed_at":"2015-05-04T20:15:12Z","body":"Hello! Thanks for creating this nice tool. I'm using it to test an API that takes EDN in the post body. I see that the `body` defmulti has support for passing a String and it being served to Ring as a `ByteArrayInputStream`, but the `request` method itself foils it by adding content-type `application/x-www-form-urlencoded` (and the `multipart/multipart?` fails if you don't pass it a map).\r\n\r\nIs there any support for POSTing non-urlencoded with peridot? Any thoughts on how to do it?"},"comment":{"url":"https://api.github.com/repos/xeqi/peridot/issues/comments/131244293","html_url":"https://github.com/xeqi/peridot/issues/22#issuecomment-131244293","issue_url":"https://api.github.com/repos/xeqi/peridot/issues/22","id":131244293,"user":{"login":"mkorvas","id":2321069,"avatar_url":"https://avatars.githubusercontent.com/u/2321069?v=3","gravatar_id":"","url":"https://api.github.com/users/mkorvas","html_url":"https://github.com/mkorvas","followers_url":"https://api.github.com/users/mkorvas/followers","following_url":"https://api.github.com/users/mkorvas/following{/other_user}","gists_url":"https://api.github.com/users/mkorvas/gists{/gist_id}","starred_url":"https://api.github.com/users/mkorvas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mkorvas/subscriptions","organizations_url":"https://api.github.com/users/mkorvas/orgs","repos_url":"https://api.github.com/users/mkorvas/repos","events_url":"https://api.github.com/users/mkorvas/events{/privacy}","received_events_url":"https://api.github.com/users/mkorvas/received_events","type":"User","site_admin":false},"created_at":"2015-08-14T21:39:36Z","updated_at":"2015-08-14T21:39:36Z","body":"I know this ticket is closed -- but I have run into the exact problem that the title of this issue implies. I tried to construct and send to the app a POST request with Content-Type: application/json but was getting rejected by the handler with 415 Unsupported Media Type.\r\n\r\nReading the source a few times (I am new to Clojure...) and seeing this discussion, I figured that to send such a request, I have to say not just\r\n```Clojure\r\n(request uri\r\n         :request-method :post\r\n         :content-type \"application/json\"\r\n         :body some-json-string)\r\n```\r\n(headers ended up being only `{\"host\" \"localhost\"}`)\r\nor\r\n```Clojure\r\n(request uri\r\n         :request-method :post\r\n         :headers {\"content-type\" \"application/json\"}\r\n         :body some-json-string)\r\n```\r\n(headers got overwritten to `{\"host\" \"localhost\", \"content-type\" \"application/x-www-form-urlencoded\"}`)\r\nbut I **must include both `:headers` and `:content-type`**:\r\n```Clojure\r\n(request uri\r\n         :request-method :post\r\n         :headers {\"content-type\" \"application/json\"}\r\n         :content-type \"application/json\"\r\n         :body some-json-string)\r\n```\r\n\r\nI was reluctant to call `(content-type \"application/json\")` in the \"thread\" as the docs say it makes the setting persistent also for following requests which I certainly didn't want... although I now realize that specifying `:content-type \"application/json\"` in the `(request)` arguments probably has the same effect.\r\n\r\nThis wasn't really clear from the docs, so I would find it nice to mention this feature there. Even nicer would be to be able to ask for removing the `:content-type` key from the session upon issuing the next request to the app -- not having the `:content-type` setting persist for all future requests. (I will be glad if you tell me I missed something and this behaviour is already there!)"}}