-
Notifications
You must be signed in to change notification settings - Fork 509
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
HTTP: Support for other operations #2383
Comments
Most plain HTTP Serve doesn't define the |
@Xuanwo I will take a look. I was looking into using OpenDAL to replace some code running with aiohttp in Python. Still not sure if it's the the right tool though. |
Very happy to hear that! I'm willing to provide help for this! |
@Xuanwo We were able to use HTTP/WebDAV to do GET/HEAD, one thing that was confusing is that these services only support the AsyncOperator. Another thing I noticed is that WebDAV is missing POST, even though it's mentioned in the RFC (https://datatracker.ietf.org/doc/html/rfc4918) |
Yes. We depends on
OpenDAL is not a one-to-one mapping of storage services' API. Can you share more details on the operation you want to do over storage service? For POST on webdav, you want to create a new dir? |
That makes sense, it was only confusing at first since libs like Request let do blocking HTTP operations.
I'm trying to upload files, the server has a POST route. I could add a PUT route because I manage the server code, but if it was a third party server, I wouldn't be able to POST data. Another thing I want to try is Streaming Upload big files. Mainly so that they don't get loaded into memory. I noticed some of the methods support FilePath's but I havent tested if they get loaded into memory or streamed. I currently to this with aiohttp using this: https://docs.aiohttp.org/en/stable/client_quickstart.html#streaming-uploads Or with requests using this: https://docs.python-requests.org/en/v1.2.3/user/advanced/#streaming-uploads Main difference being that requests is a blocking operation, while aiohttp doesn't block. |
Thanks for pointing out! We are working on this now: #2084. By adding Besides, OpenDAL rust core already supports |
Good to know, I will hold off testing streaming files for now. Not sure if adding POST is in the timeline or out of scope for WebDAV |
There are many ways to upload a file via |
Maybe we can use |
Yes, it's possible. However, the process is more complex as we also need to convert |
I just have a custom REST server that supports uploading files. Currently I do so using the aiohttp/requests example posted above. aiohttp: https://docs.aiohttp.org/en/stable/client_quickstart.html#streaming-uploads requests: https://docs.python-requests.org/en/v1.2.3/user/advanced/#streaming-uploads Small data is not streamed, just send as a payload. |
Sorry, OpenDAL cannot be used in this case. It is designed to connect with storage services instead of a custom API that may not be general enough and could be difficult to work with accurately. |
How about adding a service named "REST", and having OpenDAL be able to do rest operations like GET, HEAD, PUT, POST, DELETE ? |
Thanks for the advice. However, file uploading involves more than a simple
Therefore, OpenDAL can only connect with services that have clear API specifications covering all these details. We are willing to implement such a service if you need it. |
i see what you mean, thanks for your help. I will close this as solved. For now aiohttp/requests work fine |
Currently the HTTP service only supports GET and HEAD. Are there plans to add support for POST and PUT. It would be great to be able to also send data, instead of only reading.
The text was updated successfully, but these errors were encountered: