Re: Preventing url-encoding of POST body in http-kit.client

2014-11-14 Thread Francis Avila
What you are describing is not url-encoding but xml-entity-quoting. The 
problem is not with the http-kit client but somewhere else in your stack.

On my system (http-kit 2.1.16) I get the expected result:

In a terminal:

$ nc -l localhost -p 


In a repl:

@(org.httpkit.client/post "http://localhost:"; {:body "bar"})




Back in the terminal, I see:

GET / HTTP/1.1
Host: localhost:
Accept: */*
User-Agent: http-kit/2.0
Accept-Encoding: gzip, deflate
Content-Length: 14


bar


On Friday, November 14, 2014 6:47:23 AM UTC-6, Saju Ravindran Pillai wrote:
>
> Hi, 
>
> I need to POST an XML body to an http endpoint, which replies back with a 
> xml response. 
>
> I do this .. 
> (org.httpkit.client/post uri {:body (str “bar”)}) 
>
> but the client is encoding the xml tags to > & < 
>
> I then tried : 
>
> (org.httpkit.client/post uri {:body (str “bar”) 
>  :content-type 
> "application/octet-stream" 
>  :content-encoding 
> "application/octet-stream” 
>  :mime-type 
> “application/octet-stream” 
>  :body-encoding 
> “application/octet-stream”}) 
>
> .. hoping that one of those options will do the trick — but no luck. 
>
> How do I prevent http-kit from url-encoding the post body? 
>
> -srp 
> ps: 
>
> The following works … 
>
>  curl -X POST -d @file http://uri/ 
> $ cat file 
> bar 
>
>  
>
> This e-mail message is authorized for use by the intended recipient only 
> and may contain information that is privileged and confidential. If you 
> received this message in error, please call us immediately at (425) 
> 590-5000 and ask to speak to the message sender. Please do not copy, 
> disseminate, or retain this message unless you are the intended recipient. 
> In addition, to ensure the security of your data, please do not send any 
> unencrypted credit card or personally identifiable information to this 
> email address. Thank you. 
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Preventing url-encoding of POST body in http-kit.client

2014-11-14 Thread Sam Ritchie

How about just decoding on the other side?


Saju Ravindran Pillai 
November 14, 2014 at 5:46 AM
Hi,

I need to POST an XML body to an http endpoint, which replies back 
with a xml response.


I do this ..
(org.httpkit.client/post uri {:body (str “bar”)})

but the client is encoding the xml tags to > & <

I then tried :

(org.httpkit.client/post uri {:body (str “bar”)
:content-type "application/octet-stream"
:content-encoding "application/octet-stream”
:mime-type “application/octet-stream”
:body-encoding “application/octet-stream”})

.. hoping that one of those options will do the trick — but no luck.

How do I prevent http-kit from url-encoding the post body?

-srp
ps:

The following works …

curl -X POST -d @file http://uri/
$ cat file
bar



This e-mail message is authorized for use by the intended recipient 
only and may contain information that is privileged and confidential. 
If you received this message in error, please call us immediately at 
(425) 590-5000 and ask to speak to the message sender. Please do not 
copy, disseminate, or retain this message unless you are the intended 
recipient. In addition, to ensure the security of your data, please do 
not send any unencrypted credit card or personally identifiable 
information to this email address. Thank you.




--
Sam Ritchie (@sritchie)
Paddleguru Co-Founder
703.863.8561
www.paddleguru.com 
Twitter // Facebook 



--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups "Clojure" group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Preventing url-encoding of POST body in http-kit.client

2014-11-14 Thread Saju Ravindran Pillai
Hi,

I need to POST an XML body to an http endpoint, which replies back with a xml 
response.

I do this ..
(org.httpkit.client/post uri {:body (str “bar”)})

but the client is encoding the xml tags to > & <

I then tried :

(org.httpkit.client/post uri {:body (str “bar”)
 :content-type 
"application/octet-stream"
 :content-encoding 
"application/octet-stream”
 :mime-type “application/octet-stream”
 :body-encoding 
“application/octet-stream”})

.. hoping that one of those options will do the trick — but no luck.

How do I prevent http-kit from url-encoding the post body?

-srp
ps:

The following works …

 curl -X POST -d @file http://uri/
$ cat file
bar



This e-mail message is authorized for use by the intended recipient only and 
may contain information that is privileged and confidential. If you received 
this message in error, please call us immediately at (425) 590-5000 and ask to 
speak to the message sender. Please do not copy, disseminate, or retain this 
message unless you are the intended recipient. In addition, to ensure the 
security of your data, please do not send any unencrypted credit card or 
personally identifiable information to this email address. Thank you.

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.