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

Use POST instead of GET #1

Closed
pitufo opened this issue May 17, 2016 · 0 comments
Closed

Use POST instead of GET #1

pitufo opened this issue May 17, 2016 · 0 comments

Comments

@pitufo
Copy link

pitufo commented May 17, 2016

The Labelary API supports a GET variant and a POST variant. The GET variant embeds the ZPL in the URL. As a result, the ZPL is truncated if it is very long, because URLs are truncated if they are very long:

http://stackoverflow.com/questions/2659952/maximum-length-of-http-get-request

If the ZPL is truncated, it will be missing the final ^XZ command, which prevents the label from printing/rendering and returns the following error in Labelary:

ERROR: requested label 0, but there are only 0 labels

Instead of using the GET variant, the code should use the POST variant to avoid this issue:

https://github.com/sbinkert/ZplPrinter/blob/master/ZplPrinter/js/main.js#L26

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

No branches or pull requests

1 participant