Join the Webstudio community

Updated 2 days ago

POST as base64?

Is it possible to encode the JSON body as base64 in a form?

I was trying to build a form that could generate a file on my GitHub repo using their API, but it seems like the field needs to be base64-encoded. (I could probably send this to n8n but I was wondering if there was a Webstudio solution)
O
J
10 comments
are you tring to generate a file using a form?
yes, exactly.
I am a little confused how that would work, even if you could convert the fields to base64
what would that file contain? the data submitted by the form but encoded in base64 and packed as a file?
can you link me to the relevant github documentation?
This is an extension of this https://discord.com/channels/955905230107738152/955905231227609158/1320949577540571247. I forked the repo and was able to use DecapCMS as my headless solution. I then was trying to create a form in Webstudio that would allow me to create a new blog post. I was able to generate a new post in Insomnia (or Postman) with this way only if I used a Base64 version. I used AI to help me get that far.

https://docs.github.com/en/rest/repos/contents?apiVersion=2022-11-28#create-or-update-file-contents
Basically, I was trying to use Github/DecapCMS as my backend CMS without every seeing it (after initial setup).
afaik files are automatically encoded in forms by the browser, but not the regular fields
fields are not a file, its just info, you would still need to turn that text into some kind of file, because essentially there is no logic that would do that
ok, thanks. I will probably test with n8n at some point then.
Add a reply
Sign up and join the conversation on Discord