-
-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
how to add custom cookies using martian and clj-http #84
Comments
Hi @bhougland18 I would approach it like this: (defn with-cookie-store [cookie-store]
{:name ::with-cookie-store
:enter (fn [ctx]
(assoc-in ctx [:request :cookie-store] cookie-store))})
(defn build-martian []
(let [cookie-store (clj-http.cookies/cookie-store)]
(martian.clj-http/bootstrap-swagger "http://swagger.com/swagger.json"
{:interceptors (cons (with-cookie-store cookie-store)
martian.clj-http/default-interceptors)))) The entire map built up under the Hope this helps |
Hi @bhougland18 shall I close the issue? |
Oliver,
Yes. Sorry, I have been very busy. I am really grateful for your help.
…On Mon, May 11, 2020 at 11:11 AM Oliver Hine ***@***.***> wrote:
Hi @bhougland18 <https://github.com/bhougland18> shall I close the issue?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#84 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AGZANCHO5F7LAANNHIU6RELRRAIQTANCNFSM4MT4Q6KQ>
.
|
Great, thanks for letting me know. |
This helped me, thank you for the snippet |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I apologize for submitting an issue for a question, but how would you add a clj-http cookiestore as an interceptor? I am assuming that is the correct way to accomplish this objective.
To do this using native clj-http one could do:
(def cs (clj-http.cookies/cookie-store))
(def http-client-response
(clj-http.client/get
"https://httpbin.org/cookies"
{:cookie-store cs})))
The text was updated successfully, but these errors were encountered: