std.net.curl doesn't provide information when something fails. Consider the following (not terribly obvious) typo:
client.addRequestHeader("Content-Type", "Application/json");
followed by a call to post:
post("https://api.todoist.com/rest/v1/tasks", cmd, client);
You get only a generic error message:
HTTP request returned status code 400 ()
Compare this with the error message if you do the same thing with command line curl. The message is:
Empty content
That immediately points you in the right direction. What is the typo? The line at the beginning should be
client.addRequestHeader("Content-Type", "application/json");
"Status code 400" does not help. "Empty content" does.
Comment #1 by robert.schadek — 2024-12-01T16:39:04Z