Closed rumbin closed 2 years ago
POST
is documented here: https://docs.kroki.io/kroki/setup/usage/
Thanks for this issue, it is a good idea to use this config parameter. I will try to implement it, but it could take some time. PRs are generally welcome
@rumbin Can you provide some test data to reproduce the issue?
Any complicated or large export from excalidraw.com should work. Facing this as well, would be great if it could be switched to POST
.
I just looked into this issue, but as far as I can see, there is other basic problem with that. At the moment, default configuration is to embed the drawings in an html img tag with the URL as source. It seems so, that Image-Tags in html can only have GET-Requests as source (Am I correct?).
If so, I only see the option to first download the drawing (which is optional at the moment). So a solution could be:
Feedback please!
Not sure I fully understand the image tag reference and I have limited Python knowledge, but looking at the plugin code, it seems that it is using urlretrieve
which by default uses GET
.
Maybe there is another way to implement this using the standard library by passing in data
and making it use POST
instead. Also, any reason to not just always use POST
?
@b-bittner Yes, you are right. Your solution would work as a quick fix.
I looked into the asciidoc plugin and it seems, that they are doing the request via JS in the browser at a later stage. This may also be an option.
This issue should now be fixed with #7
Problem Description
When an (excalidraw) drawing is too large (contains too many characters), then the URI becomes too large. This results in the image not being renderd in MkDocs. Instead, a placeholder image is shown:
I suppose that this is caused by the drawing code being too long. At least that is what https://kroki.io/#try shows when providing a too long excalidraw JSON.
Possible solution:
Switch to
POST
, either always or only if the URI would become too long. For reference, see identical issues of other languages and their solutions:kroki-http-method