#Issues Sending HTTP POST Request to Zebra Printer From Appsmith

1 messages · Page 1 of 1 (latest)

stone bone
#

Howdy! I'm having an issue sending ZPL print commands via a REST API query to an internal Zebra printer we have setup. While the POST request returns a 200 status on Appsmith's end, there is nothing being printed and there is nothing showing up in the print log. In order to narrow down the issue, I ran the following curl command from the same server our Appsmith instance is hosted on:

curl http://<internal-ip>/pstprnt --data "^XA^FO80,100^BY3^BCN,100,,,,A^FDTest^FS^XZ"

This request resulted in a successful print. However, when I import this cURL command and execute it from the Appsmith UI, the request does not appear to be received by our printer.

This is occurring on a self-hosted instance of Appsmith Business v1.9.37.1.

acoustic hedgeBOT
#

Hey There,

We've registered your query, and our team will get back to you soon.

Regards,
Pranav

acoustic hedgeBOT
#

Hello! It seems that you are using an older version of Appsmith. Could you
please update your instance to the latest
version

and let us know if the issue persists there?

Could you also send the API documentation for the endpoint you're using?

This page provides steps to update Appsmith to the latest version on your self-hosted Appsmith instance.

stone bone
#

Will do! I'll proceed with an update and report back.

stone bone
#

Ok, I've updated to v1.9.43. I attempted the same query as before. It still doesn't seem to be reaching our internal printer server.

fierce escarp
#

@stone bone , after importing the curl into Appsmith, what body type is being used to send the data? Try setting it to RAW if it's not there already. Also try with and without the quotes.

stone bone
#

@fierce escarp After importing the command, the body type actually defaults to NONE. So I set it to RAW and ran the request. I'll try again with and without quotes to see if it makes a difference.

#

Ok, the quotations didn't appear to make a difference.

fierce escarp
#

@stone bone , I just noticed your curl is http, not https. Can you try updating the API after importing, or re-import with https and see if that helps?

stone bone
#

@fierce escarp I tried that as well and unfortunately, it didn't appear to make a difference. I ended up implementing and deploying a simple REST API to proxy the print request. Setting up a REST API query against the service I implemented worked as expected. I am a bit puzzled that I am not able to send an HTTP POST request directly to the print server. 🤔

fierce escarp
#

@stone bone , glad you found a workaround at least. I may know what the issue is. Could you please check the timeline in postman when you POST directly to the printer?
Please see if the server responds with a 302 redirect to a GET request before responding with a 200 response.