coddingtonbear / obsidian-local-rest-api

Unlock your automation needs by interacting with your notes in Obsidian over a secure REST API.
MIT License
607 stars 56 forks source link

feat: binary file put support #89

Closed rowthan closed 9 months ago

rowthan commented 9 months ago

put file by api not only plain text

rowthan commented 9 months ago

@coddingtonbear is there any demo for binary file put ?

coddingtonbear commented 9 months ago

You're totally right; it didn't work! I still don't think that using multipart/form-data is the right choice, though, and have here made a few changes to change things such that they just directly accept the payload data according to the specified Content-Type header. Have a look and let me know if you can see a problem here.

rowthan commented 9 months ago

You're totally right; it didn't work! I still don't think that using multipart/form-data is the right choice, though, and have here made a few changes to change things such that they just directly accept the payload data according to the specified Content-Type header. Have a look and let me know if you can see a problem here.

agree totally. the reason why i choose ‘multipart/form-data’ is that I just had not find a better way. if you can made it pass the same arguments for both string and binary. is’s really great