Closed matbech closed 6 years ago
I can't reproduce your error. I just tested the endpoints they respond correctly.
I tried it with different pictures and different text messages. Is there an option where the application writes the server responses to a file? Maybe there is some human readable error message in the 400 response.
Yes, there is.
You can add -v
flags before specifying the command. The more v
s the more verbose the log messages. (see --help option before specifying a command).
postcards-chuck-norris -vvvvv send --config config.json --key
Error codes 400 indicate invalid text in either message payload or sender/recipient fields.
I currently do some basic unicode data encoding only for the text message.
If your sender/recipient fields contain some non ascii characters you likely run into issues there. Also the Postal service backend can't handle emojis.
The request sent by the client was syntactically incorrect.
> HTTP/1.1 400 Bad Request
> Server: nginx/1.11.10
> Date: Wed, 02 May 2018 09:03:34 GMT
> Content-Type: text/html;charset=utf-8
> Content-Length: 1029
> Connection: keep-alive
> Keep-Alive: timeout=5
> Content-Language: en
>
<!DOCTYPE html><html><head><title>Apache Tomcat/8.0.14 (Debian) - Error report</title><style type="text/css">H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}.line {height: 1px; background-color: #525D76; border: none;}</style> </head><body><h1>HTTP Status 400 - </h1><div class="line"></div><p><b>type</b> Status report</p><p><b>message</b> <u></u></p><p><b>description</b> <u>The request sent by the client was syntactically incorrect.</u></p><hr class="line"><h3>Apache Tomcat/8.0.14 (Debian)</h3></body></html>
Right, the umlaut ü in the address caused the error. It should probably be xml character &#x encoded. Thanks.
Error codes 400 indicate invalid text in either message payload or sender/recipient fields.
^this
Sender/recipient fields are embedded two svg files (one for the front cover and the other one for the back cover of the postcard). My guess is that you submit non-ascii characters which render the svg files invalid.
The ü is utf-8 encoded and IE didn't complain about the front side .svg. However, the postcard creator uses xml character unicode &#x encoding.
As I stated, I don't encode other fields than the message payload.
you are welcome to submit a PR at the postcard_creator_wrapper project so that those fields are encoded as well :) /close
I'm using the latest version (0.0.8) and I get the following error: