Created
July 18, 2013 20:23
-
-
Save cap10morgan/6032742 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Jetty: | |
Request: {:ssl-client-cert nil, :remote-addr 0:0:0:0:0:0:0:1, :scheme :http, :query-params {}, :form-params {}, :body-params {name Test Election, date 2013-08-01}, :request-method :post, :query-string nil, :route-params {}, :content-type application/json, :uri /elections, :server-name localhost, :params {:name Test Election, :date 2013-08-01}, :headers {user-agent Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.71 Safari/537.36, cookie _turbovote_session=BAh7DEkiD3Nlc3Npb25faWQGOgZFRkkiJTI2MTQ1NWQxNDEyNWRmZWQ2YzAwZjFjNjlmMjg2N2IzBjsAVEkiC2xvY2FsZQY7AEZJIgdlbgY7AFRJIgtsYXlvdXQGOwBGSSIRZmllbGRvZnR1cmJvBjsAVEkiEF9jc3JmX3Rva2VuBjsARkkiMWtsNW5TcndPbnFsS2ZFOFcyeFdaU1MzK1lWU1kwQytBY0VPRDZXa053QXM9BjsARkkiHGhhdC10cmljay52aXNpdGVkX3N0ZXBzBjsARlsHOgppbnRybzoLYmFzaWNzSSIcaGF0LXRyaWNrLnNraXBwZWRfc3RlcHMGOwBGWwBJIhFpcF9hZGRyZXNzZXMGOwBGWwciDjEyNy4wLjAuMUkiDmxvY2FsaG9zdAY7AEY%3D--ceabd2996969d8d45481836099f06d623bd5223c, origin chrome-extension://cokgbflfommojglbmbpenpphppikmonn, accept application/json, host localhost:3000, content-type application/json, accept-encoding gzip,deflate,sdch, content-length 48, accept-language en-US,en;q=0.8, connection keep-alive}, :content-length 48, :server-port 3000, :character-encoding nil, :body #<ByteArrayInputStream java.io.ByteArrayInputStream@2b6a702b>} | |
Notice the body-params which gets merged into the params value. | |
JBoss: | |
Request: {:ssl-client-cert nil, :remote-addr 127.0.0.1, :scheme :http, :query-params {}, :context /elections-api, :form-params {}, :request-method :post, :query-string nil, :route-params {}, :content-type application/json, :path-info /elections, :uri /elections-api/elections, :server-name localhost, :params {}, :headers {user-agent Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.71 Safari/537.36, cookie _turbovote_session=BAh7DEkiD3Nlc3Npb25faWQGOgZFRkkiJTI2MTQ1NWQxNDEyNWRmZWQ2YzAwZjFjNjlmMjg2N2IzBjsAVEkiC2xvY2FsZQY7AEZJIgdlbgY7AFRJIgtsYXlvdXQGOwBGSSIRZmllbGRvZnR1cmJvBjsAVEkiEF9jc3JmX3Rva2VuBjsARkkiMWtsNW5TcndPbnFsS2ZFOFcyeFdaU1MzK1lWU1kwQytBY0VPRDZXa053QXM9BjsARkkiHGhhdC10cmljay52aXNpdGVkX3N0ZXBzBjsARlsHOgppbnRybzoLYmFzaWNzSSIcaGF0LXRyaWNrLnNraXBwZWRfc3RlcHMGOwBGWwBJIhFpcF9hZGRyZXNzZXMGOwBGWwciDjEyNy4wLjAuMUkiDmxvY2FsaG9zdAY7AEY%3D--ceabd2996969d8d45481836099f06d623bd5223c, origin chrome-extension://cokgbflfommojglbmbpenpphppikmonn, accept application/json, host localhost:8080, content-type application/json, accept-encoding gzip,deflate,sdch, content-length 48, accept-language en-US,en;q=0.8, connection keep-alive}, :content-length 48, :server-port 8080, :character-encoding nil, :body #<CoyoteInputStream org.apache.catalina.connector.CoyoteInputStream@782624de>} | |
No body-params, and thus empty params. However, if you read the body InputStream, it has the JSON in it: | |
(println "Body:" | |
(clojure.string/join "\n" | |
(line-seq (clojure.java.io/reader | |
(get-in ctx [:request :body]))))) | |
prints... | |
Body: {"name": "Test Election", | |
"date": "2013-08-01"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment