String signature = "POST" + "\n" + "/api/v1/..."
and String signature = "POST\n/api/v1/..."
don't result in identical variables, so I'm a bit puzzled why that would result in an error.However, there's a quoting error in the failing example where the double quotes in the JSON body aren't properly escaped:
String signature = "POST" + "\n" + "/api/v1/query" + "\n" + token + "\n" + timestamp + "\n" + "{"body":"content"}"
It may just be the example that's not correctly formatted, but the other (working) example does in fact escape the double quotes in the JSON. I guess, depending on how forgiving the used language is with quoting, that could also be the source of the error?Another thing that's really broken is the last string with unescaped quotes.
Not sure how to interpret that unless theres a `:` (colon) operator.
signature = fr'{path}\r\n{token}\r\n{timestamp}'
So if this is indeed the API they're using it's not only literal "\\n" but also "\\r\\n", no "POST", and no body at the end.Also when copy/pasting into Python to try it, I got an error because \“ is in fact U+201C not an ASCII quote. (Surely that's not the subtle issue?)
"POST" + "\\n" + ...Not sure if the author tried to just start a new thread. But anyway, for now you always need to keep an eye on these things and manage it if it follows red herrings or ends up in some logical loop
Sidenote : newlines is one thing tat can be quite tricky for llms in general.
kichik•2mo ago
lillesvin•2mo ago
kichik•2mo ago
lillesvin•2mo ago
Or am I misunderstanding you?
kichik•2mo ago
lillesvin•2mo ago
But couldn't you then just make the call to an echo service (like HTTPbin) or simply dump the request when you send it?
kichik•2mo ago
lillesvin•2mo ago