-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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 handler #478
Comments
custom HTTP? can you provide a sample? @arjunmenon |
I also have a similar request. What i basically want to understand, is there a way to handle custom http methods? Like in the above example @arjunmenon wants to define a Method.NOTIFY. The server should be able to understand the http method "NOTIFY" and accordingly handle the request. But in the current case and custom method, changes it to Method.OPTIONS. SO kindly help us to understand how to do it. |
I think its not possible in previous version which are in maven. Since they are locked in an enum. Wonder why though they have mentioned this in their feature list -
The original version of Nanohttps simply checked for String - https://github.com/NanoHttpd/nanohttpd-java-1.1/blob/nanohttpd-for-java1.1/NanoHTTPD.java#L86 |
A PR was just approved with a quick and dirty addition to the Method enum. In a future version I plan to make this a truly extensible system. |
Hey
What is a simple example of handling a custom HTTP method?
Frankly, there is not much how-to on this and I really want to know.
PS want to handle NOTIFY and SUBSCRIBE HTTP methods and return a 200 OK
The text was updated successfully, but these errors were encountered: