Skip to content
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

Custom HTTP Verbs #724

Open
BaumgartnerWilliam opened this issue Sep 27, 2022 · 2 comments
Open

Custom HTTP Verbs #724

BaumgartnerWilliam opened this issue Sep 27, 2022 · 2 comments

Comments

@BaumgartnerWilliam
Copy link

BaumgartnerWilliam commented Sep 27, 2022

Hi guys,

I wanted to change the list of supported http verbs in my server. Is there currently a way to do that ?
For instance: if I wanted to support the QUERY HTTP METHOD. How would I make it so is doesn't complain with the assert (code below) ?

Code Reference:

(def ^:private default-verbs #{:any :get :put :post :delete :patch :options :head})

(assert (known-verb verb) (syntax-error ctx "the verb (second element)" (str "one of " known-verb) verb))

Thank you.

@BaumgartnerWilliam
Copy link
Author

BaumgartnerWilliam commented Sep 27, 2022

I don't know whether this functionality is documented or not but one of my colleagues whist reading the tests found out about this.

Which allowed us to define custom verbs and solve our particular issue like so:

(def routes
  (io.pedestal.http.route.definition.table/table-routes 
    {:verbs #{:any :get :put :post :delete :patch :options :head :query}} my-routes))

@claj
Copy link
Contributor

claj commented Jan 2, 2023

Yes, it is possible to customize what verbs should be allowed: #443

It looks like it shuld be part of some documentation, but it seems to work like BaumgartnerWilliam shows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants