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

URL dispatcher mapping now also supports response/request mime type #68

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

cyborgsimon
Copy link

  • the response mime type will be checked against the HTTP Accept Header
  • the response mime type will be set for the response
  • the request mime type will checked against the Content Type of the request

example:

dispatcher().map("(PUT|POST)", "text/html", "application/x-www-form-urlencoded", "/res_7/(a(\\d+))/(a(\\d+))/(a(\\d+))", &disp::p_3,this,2,4,6);

This will e.g. map correctly with a request with:

  • PUT as HTTP request method
  • text/html,text/xhtml as HTTP Accept
  • application/x-www-form-urlencoded; charset=utf-8 as HTTP request content type

More information / examples can be found in the code documentation (url_dispatcher.h) or the unit tests (url_mapper_test.cpp)

…me type and request mime type in addition to method and url

- the response mime type will be checked against the HTTP Accept Header
- the response mime type will be set for the response
- the request mime type will checked against the Content Type of the request
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

Successfully merging this pull request may close these issues.

1 participant