Waboodoo / HTTP-Shortcuts

Android app to create home screen shortcuts that trigger arbitrary HTTP requests
https://http-shortcuts.rmy.ch
MIT License
1.17k stars 113 forks source link

File content as variable #401

Open brunetton opened 10 months ago

brunetton commented 10 months ago

Just discovered this (amazing!) project and I'm very excited to see what it can achieve 🤩

But, very related to #102, I'm afraid I need to be able to access a specific file from a variable.

Context

I'm trying to find a way to update the content of a HackMD note using HackMD API. The new content of the online note will be the content of a (predefined specific) file.

Problem detail

Following API documentation, to update a note there I need to make a request with a json body like this:

{
   "content": "{file_content}"
}

Where file_content is the content of a particular file (always the same file).

Conclusion

As far as I see, the solution proposed by the file content mechanism is not sufficient to cover my use case, as sending the file content as request body won't do the trick unfortunately, as I need to pass its content in the request's json body.

I hope that I missed something !

Thanks very much for this excellent app (again)

braboobssiere commented 10 months ago

not sure it's the same thing but i also want to store file as blob for using later?

Waboodoo commented 3 months ago

As of version 3.16.0, it is possible to read and write files from Scripting. Documentation for this can be found here: https://http-shortcuts.rmy.ch/scripting#read-write-files

This should hopefully address both the original issue described here, as well as @braboobssiere's need to comment.