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

How to respond to OPTIONS request? #170

Open
ParkSeungwon opened this issue Oct 15, 2022 · 1 comment
Open

How to respond to OPTIONS request? #170

ParkSeungwon opened this issue Oct 15, 2022 · 1 comment

Comments

@ParkSeungwon
Copy link

I could find how to respond to GET or POST request.(http_post or http_get function)
But how can I define respose to OPTIONS request?

@eao197
Copy link
Member

eao197 commented Oct 15, 2022

Hi, if you use express-router then it's necessary to use router's add_handler method:

router->add_handler(
	restinio::http_method_options(),
	"/options/demo",
	my_handler );

More information can be found here

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