Comments (7)
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 GET
and POST
right now, this was based on how HTML forms work. We didn't plan to add support for other HTTP methods, but it is something we could do if it makes it easier to use.
What language/framework are you using for your backend? Many frameworks support passing the method as a query param, eg POST /resource/123?method=delete
. Happy to help here.
from hyperview.
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.
from hyperview.
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 "multipart/form-data; boundary=df2cf318-a7e6-4a73-b315-ff04b3619d0e"
. Looking around a bit it seems like people add the multer to be able to parse these. I configure it with the .none()
option because the docs say this is for parsing fields and does not accept any file uploads.
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?
from hyperview.
Alright I had some time to continue with the project again. I got the multipart request parsing to work with fine with connect-multiparty
from hyperview.
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.
from hyperview.
Related Issues (20)
- Complete web-view implementation for web
- Demo app: Clipboard behavior using deprecated API
- `show-during-load`/`hide-during-load` don't have effect with `action="reload"`
- list items within a section list affect the upper level of items. HOT 3
- Django Integration and deploy on android apk HOT 1
- Send data from webview message? HOT 5
- Allow picker-field customization
- Padding style property HOT 2
- Take pictures with camera HOT 2
- `<select-single>`'s `allow-deselect` attribute not parsed correctly HOT 1
- Implement `picker-field` for web
- [CVE-2022-39353] Vulnerability in xmldom-instawork HOT 2
- Could Hyperview be used together with something like Builder X?
- Using react-navigation native header for screens HOT 2
- Trigger `change` is not working with action `dispatch-event` if there is no `delay` attribute HOT 6
- [Security Issues Collection] Security Findings Fixing HOT 6
- App bar issues, header overlaping with phone top bar / header HOT 5
- How to change the demo app source link? HOT 4
- Is there a system action to save user data locally? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hyperview.