HTTP Post error using ESP8266 from Arduino
You are mixing up two different ways of sending information to a server.

When you use postman with the URL

192.168.1.134/api/create/current/?outlet_id=1&amp;voltage=2&amp;vrms=3&amp;amps_rms=4


You are not actually sending any useful information in the body, but rather sending all of the data as URL parameters.

In contrast, your embedded code:

String uri = "/api/create/current/"; // API Route
String payload = "?outlet_id=1&amp;voltage=2&amp;vrms=3&amp;amps_rms=4"; // Sample sensor payload


attempts to supply the "payload" in the message body.

But the problem is that your payload is not encoded as json, but rather still encoded as a series of URL parameters.

You should either add that "payload" string onto the end of the URL and not send it in the body.

Or else, if your server supports it, encode the payload as proper json, probably something like:


  {"outlet_id": 1, "voltage": 2, "vrms": 3, "amps_rms": 4}


Note that if you want to put this as a constant into a C/C++ program, you'll have to escape the quotes, for (brief) example:

String payload = "{\"outlet_id\": 1}";


Also should you have any json values beyond numbers and true/false/null those would need their own quotes, eg


  {"mode": "test"}


Ultimately this is an everyday RESTful API question more suited to Stackoverflow and not an embedded or EE question at all, though needing to be able to work with these kinds of things isn't uncommon in the age of IoT.