Skip to content
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

Support POST requests #69

Closed
evandrocoan opened this issue Feb 13, 2018 · 2 comments · Fixed by #305
Closed

Support POST requests #69

evandrocoan opened this issue Feb 13, 2018 · 2 comments · Fixed by #305

Comments

@evandrocoan
Copy link

evandrocoan commented Feb 13, 2018

Because GET requests have a char length limit

from urllib.parse import urlencode
from urllib.request import Request, urlopen

url = 'http://localhost:8080/plantuml/post'
post_fields = {'source': r'@startuml\na --> b\na <-- b\n@enduml'}

request = Request(url, urlencode(post_fields).encode())
answer = urlopen(request).read().decode()
print(answer)

Would be useful for internal application as:

  1. https://github.com/qjebbs/vscode-plantuml
  2. https://github.com/pkucmus/sublime-plantuml

With this they can render the images much faster and can handle big diagrams:

Plugin supports two renders: Local and PlantUMLServer.

Local is the default and traditional way. If you care more about export speed, you should try PlantUMLServer.

Local: 6 documents, 9 digrams, 14 files exported in 24.149 seconds
PlantUMLServer: 6 documents, 9 digrams, 14 files exported in 1.564 seconds

@llaville
Copy link

llaville commented Feb 5, 2019

Hello,

I used the docker image from latest tag (December 22, 2018) with POST feature supported, but with a huge source code, i got such result :

Bad Message 431
reason: Request Header Fields Too Large

is there a solution to fix such situation ?
Thanks in advance

@HeinrichAD
Copy link
Collaborator

For documentary reasons: It is possible to send the diagram text/code as body via post request to get the desired response.
See examples here: #67 (comment)

About the second issue:

Bad Message 431
reason: Request Header Fields Too Large

I can not really reproduce the error with the current version v1.2023.8. If the issue is still valid, please open a separate issue including an example how to reproduce it. Please also check/include what you exactly write into the request header fields.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants