-
Notifications
You must be signed in to change notification settings - Fork 66
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
Verb http methods #493
Comments
Hi @rickheere, thanks for checking out the project. The approach you describe (looking at the Accept header to switch between HTML and Hyperview templates) works really well! We do that ourselves in some of our apps. You are correct that we only support What language/framework are you using for your backend? Many frameworks support passing the method as a query param, eg |
Thank you for the reply @adamstep. Adding the method as an parameter to get around my problem is a smart idea. I'm using nodejs with Express, I tested it out and I can just manually override the method value with some early middleware. There is even a middleware mentioned on the website Express. |
I do however have another issue. If you want me to move it to a new ticket let me know. I menage to do a POST request but it looks like my setup is not able to parse the body. I'm using body-parser which is the go to library to parse the body. I set it up in a way to look for all typ's it supports and try to parse those, this is the default interface of the library bodyParser() I get an empty body object, this is the default response of the library if there is no body. The content-type coming in says it we are dealing with a const upload = multer()
...
...
bodyParser(),
upload.none(), Now I get an error parsing the body. [node] index-0 | Error: Unexpected end of form
[node] index-0 | at Multipart._final (/home/rick/Repositories/ctoa-platform/node_modules/busboy/lib/types/multipart.js:588:17)
[node] index-0 | at callFinal (node:internal/streams/writable:694:27)
[node] index-0 | at prefinish (node:internal/streams/writable:723:7)
[node] index-0 | at finishMaybe (node:internal/streams/writable:733:5)
[node] index-0 | at Multipart.Writable.end (node:internal/streams/writable:631:5)
[node] index-0 | at onend (node:internal/streams/readable:693:10)
[node] index-0 | at processTicksAndRejections (node:internal/process/task_queues:78:11) Doe you know where it goes wrong here? |
Alright I had some time to continue with the project again. I got the multipart request parsing to work with fine with connect-multiparty |
Thanks for the update @rickheere. Glad it the request parsing works now. Multipart form data will help us support file uploads too like outlined in this issue: #300 . We are also considering adding more verb support so I'll leave this open for now. |
As a strong believer in REST (the OG REST, not the zeitgeist's bastardized REST), I would love to see all HTTP verbs supported. |
This is good work. I'm just discovering Hyperview and I'm so hyped. |
Just popping in to say that support of all verbs would be 🙌🏼 |
Hi everyone, very exciting technologie. I have a website made with HTMX and I thought. Hyperview is a hyper media client and HTMX on top of html is so a hyper media client. If I can listen to the Accept header in my API and basted on it just return another response I almost get a mobile app for free! I can reuse all my routes, my database queries and all the rules. I followed the very well working "Getting started" and went to business.
Making a GET request on / worked as expected. Then doing a form POST did not work but I assume there is something I did wrong. Looking at the documentation for the verb it dawned on me there are only GET and POST and not any of the other http methods that I used building the website because HTMX supports those.
My question is, are there planes to implement these methods? Or am I missing something and there is a good reason not to implement those.
Very exiting to see hyper media work in mobile app!
The text was updated successfully, but these errors were encountered: