user14195: So Ive setup the emoncms on my server and posted the example power1:100…power3:300 JSON POST and it logged in my INPUTS.
Now Im trying to send data from my arduino and it seems to post fine, but when I go to the INPUTS its not there for some reason.
Here is my code. Im just posting a temperature value to a new node:
#include "SoftwareSerial.h"
//For DHT22 Grove Pro
#include "DHT.h"
#define DHTPIN A1     // what pin we're connected to
#define DHTTYPE DHT22   // DHT 22  (AM2302)
DHT dht(DHTPIN, DHTTYPE);

String ssid ="myssid";
String password="mypassword";
String server = "www.santiapps.com"; // www.example.com
String uri = "/emoncms/input/post.json";// our example is /esppost.php
#define EMON_APIKEY F("myapikey")

byte dat [5];
String temp ,hum;
String data;
char dataString[200];

SoftwareSerial esp(6, 7);// RX, TX

void setup() {
  esp.begin(9600);
  Serial.begin(9600);
  Serial.println("setup");
  reset();
  connectWifi();
}

void reset() {
  Serial.println("reset");
  esp.println("AT+RST");
  delay(1000);
  if(esp.find("OK") ) Serial.println("Module Reset");
}

void connectWifi() {
  Serial.println("connect to wifi");  
  String cmd = "AT+CWJAP=\"" +ssid+"\",\"" + password + "\"";
  esp.println(cmd);
  delay(400);
  while (esp.available()){
     String inData = esp.readStringUntil('\n');
     Serial.println("Got reponse from ESP8266: " + inData);
  }


  if(esp.find("OK")) {
    Serial.println("Connected!");
  } else {
    connectWifi();
    Serial.println("Cannot connect to wifi"); }
}


void start_test () {
  //For DHT22 Grove Pro
  static char outstr1[15];
  static char outstr2[15];
  float h = dht.readHumidity();
  float t = dht.readTemperature();
  dtostrf(t, 8, 2, dataString);
  Serial.println(dataString);
}
void loop(){
  Serial.println("loop");
  start_test();
  httppost();
  delay(100000);
}

void httppost () {
  esp.println("AT+CIPSTART=\"TCP\",\"" + server + "\",80");//start a TCP connection.
  if( esp.find("OK")) {
    Serial.println("TCP connection ready");
  } 
  delay(1000);
  String postRequest="POST " + uri + " HTTP/1.0\r\n"+"Host: " + server + "\r\n" + "Accept: *" + "/" + "*\r\n"+"Content-Length: " + strlen(dataString) + "\r\n" + "Content-Type: application/x-www-form-urlencoded\r\n"+"\r\n" + "&node=fortnite&data={a:" + dataString + "}" + "&apikey=" + EMON_APIKEY;
  Serial.println(postRequest);
  String sendCmd = "AT+CIPSEND=";//determine the number of caracters to be sent.
  esp.print(sendCmd);
  esp.println(postRequest.length());
  delay(500);
  if(esp.find(">")) { 
    Serial.println("Sending.."); 
    esp.print(postRequest);
    if(esp.find("SEND OK")) { 
      Serial.println("Packet sent");
      while (esp.available()) {
        String tmpResp = esp.readString();
        Serial.println(tmpResp);
      }
      // close the connection
      esp.println("AT+CIPCLOSE");
    }
  }
}

Here is my Serial Monitor:
setup
reset
connect to wifi
Got reponse from ESP8266: AT+CWsetup
reset
Module Reset
connect to wifi
Got reponse from ESP8266:
Got reponse from ESP8266: CLOSED
Got reponse from ESP8266: WIFI DISCONNECT
Got reponse from ESP8266: `BԄQR���ȤRN�ɤRN�H��OAT+CWJAP="tha
connect to wifi
Got reponse from ESP8266: %J:E
Got reponse from ESP8266: HըRP=“myssid”,“mypassword”
Got reponse from ESP8266: busy p…
connect to wifi
Got reponse from ESP8266: AT+CWJAP=“myssid”,“mypassword”
Got reponse from ESP8266: busy p…
Got reponse from ESP8266:
Got reponse from ESP8266: O
connect to wifi
Got reponse from ESP8266: AT+CWJAP=“myssid”,“mypassword”
Got reponse from ESP8266: WIFI DISCONNEC
Connected!
Cannot connect to wifi
Cannot connect to wifi
Cannot connect to wifi
loop
31.00
TCP connection ready
POST /emoncms/input/post.json HTTP/1.0
Host: www.myserver.com
Accept: /
Content-Length: 8
Content-Type: application/x-www-form-urlencoded
    &node=fortnite&data={a:   31.00}&apikey=mykey
    Sending..
    Packet sent

    +IPD,422:HTTP/1.1 200 OK
    Server: nginx
    Date: Tue, 02 Oct 2018 21:38:18 GMT
    Content-Type: application/json
    Connection: close
    X-Powered-By: PHP/5.4.16
    Expires: Thu, 19 Nov 1981 08:52:00 GMT
    Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
    Pragm

Here is a snapshot of the posted data when I used this URL directly in my browser:

http://santiapps.com/emoncms/input/post?node=emontx&fulljson={"power1":100,"power2":200,"power3":300}&apikey=mykey
￼=========
Based on jose's suggestion:
I changed this code to:
void httppost () {
  esp.println("AT+CIPSTART=\"TCP\",\"" + server + "\",80");//start a TCP connection.
  if( esp.find("OK")) {
    Serial.println("TCP connection ready");
  }

//  //CODE USED TO BUILD COMPLETE STRING
  String apiKeyString="apikey="; 
  apiKeyString.concat(EMON_APIKEY); //JOIN PARAMETER LITERAL STRING => String Object
  //Serial.println(apiKeyString); //THIS IS NOW A STRING OBJECT
  String nodeData="&node=fortnite&data={\"a\":";
  String combinado=apiKeyString+nodeData; //COMBINE BOTH PREVIOUS STRING OBJECTS
  String finalData=combinado + dataString + "}"; //COMBINE STRING OBJECT WITH CHAR[]
  Serial.println("finalData");
  Serial.println(finalData); 
  //unsigned int tamano = strlen(dataString);
//  char postThis[100] = finalData;
//  //ADDING THIS TO POSTREQUEST +finalData; && changing length for strlen(finalData)

  delay(1000);
  String postRequest="POST " + uri + " HTTP/1.1\r\n"+"Host: " + server + "\r\n" + "Accept: *" + "/" + "*\r\n"+"Content-Length: " + finalData.length() + "\r\n" + "Content-Type: application/x-www-form-urlencoded\r\n"+"\r\n" + finalData;
  Serial.println("postRequest");
  Serial.println(postRequest);
  String sendCmd = "AT+CIPSEND=";//determine the number of caracters to be sent.

but now I dont even get the HTTP200OK response.  The result is:
loop
31.30
finalData
apikey=myKey&node=fortnite&data={"a":31.30}
postRequest


user27653: Your Serial monitor output shows the content of the POST as:
&amp;node=fortnite&amp;data={a:   31.00}&amp;apikey=mykey
I can't tell if the &amp; are actually in your serial monitor, or if your copy/paste did some kind of HTML format attempt, but &amp; is wrong and should be &
Your JSON data is not proper JSON
{a:   31.00}
should be
{"a": 31.00}

Strangely, your serial monitor output also writes Host: www.myserver.com, which doesn't match your code, where server was assigned www.santiapps.com, so that makes it difficult to trust that the serial output you show actually came from the code.

14195: <p>So Ive setup the emoncms on my server and posted the example power1:100…power3:300 JSON POST and it logged in my INPUTS.
Now Im trying to send data from my arduino and it seems to post fine, but when I go to the INPUTS its not there for some reason.</p>

<p>Here is my code. Im just posting a temperature value to a new node:</p>

<pre><code>#include "SoftwareSerial.h"
//For DHT22 Grove Pro
#include "DHT.h"
#define DHTPIN A1     // what pin we're connected to
#define DHTTYPE DHT22   // DHT 22  (AM2302)
DHT dht(DHTPIN, DHTTYPE);

String ssid ="myssid";
String password="mypassword";
String server = "www.santiapps.com"; // www.example.com
String uri = "/emoncms/input/post.json";// our example is /esppost.php
#define EMON_APIKEY F("myapikey")

byte dat [5];
String temp ,hum;
String data;
char dataString[200];

SoftwareSerial esp(6, 7);// RX, TX

void setup() {
  esp.begin(9600);
  Serial.begin(9600);
  Serial.println("setup");
  reset();
  connectWifi();
}

void reset() {
  Serial.println("reset");
  esp.println("AT+RST");
  delay(1000);
  if(esp.find("OK") ) Serial.println("Module Reset");
}

void connectWifi() {
  Serial.println("connect to wifi");  
  String cmd = "AT+CWJAP=\"" +ssid+"\",\"" + password + "\"";
  esp.println(cmd);
  delay(400);
  while (esp.available()){
     String inData = esp.readStringUntil('\n');
     Serial.println("Got reponse from ESP8266: " + inData);
  }


  if(esp.find("OK")) {
    Serial.println("Connected!");
  } else {
    connectWifi();
    Serial.println("Cannot connect to wifi"); }
}


void start_test () {
  //For DHT22 Grove Pro
  static char outstr1[15];
  static char outstr2[15];
  float h = dht.readHumidity();
  float t = dht.readTemperature();
  dtostrf(t, 8, 2, dataString);
  Serial.println(dataString);
}
void loop(){
  Serial.println("loop");
  start_test();
  httppost();
  delay(100000);
}

void httppost () {
  esp.println("AT+CIPSTART=\"TCP\",\"" + server + "\",80");//start a TCP connection.
  if( esp.find("OK")) {
    Serial.println("TCP connection ready");
  } 
  delay(1000);
  String postRequest="POST " + uri + " HTTP/1.0\r\n"+"Host: " + server + "\r\n" + "Accept: *" + "/" + "*\r\n"+"Content-Length: " + strlen(dataString) + "\r\n" + "Content-Type: application/x-www-form-urlencoded\r\n"+"\r\n" + "&amp;node=fortnite&amp;data={a:" + dataString + "}" + "&amp;apikey=" + EMON_APIKEY;
  Serial.println(postRequest);
  String sendCmd = "AT+CIPSEND=";//determine the number of caracters to be sent.
  esp.print(sendCmd);
  esp.println(postRequest.length());
  delay(500);
  if(esp.find("&gt;")) { 
    Serial.println("Sending.."); 
    esp.print(postRequest);
    if(esp.find("SEND OK")) { 
      Serial.println("Packet sent");
      while (esp.available()) {
        String tmpResp = esp.readString();
        Serial.println(tmpResp);
      }
      // close the connection
      esp.println("AT+CIPCLOSE");
    }
  }
}
</code></pre>

<p>Here is my Serial Monitor:</p>

<pre><code>setup
reset
connect to wifi
Got reponse from ESP8266: AT+CWsetup
reset
Module Reset
connect to wifi
Got reponse from ESP8266:
Got reponse from ESP8266: CLOSED
Got reponse from ESP8266: WIFI DISCONNECT
Got reponse from ESP8266: `BԄQR���ȤRN�ɤRN�H��OAT+CWJAP="tha
connect to wifi
Got reponse from ESP8266: %J:E
Got reponse from ESP8266: HըRP=“myssid”,“mypassword”
Got reponse from ESP8266: busy p…
connect to wifi
Got reponse from ESP8266: AT+CWJAP=“myssid”,“mypassword”
Got reponse from ESP8266: busy p…
Got reponse from ESP8266:
Got reponse from ESP8266: O
connect to wifi
Got reponse from ESP8266: AT+CWJAP=“myssid”,“mypassword”
Got reponse from ESP8266: WIFI DISCONNEC
Connected!
Cannot connect to wifi
Cannot connect to wifi
Cannot connect to wifi
loop
31.00
TCP connection ready
POST /emoncms/input/post.json HTTP/1.0
Host: www.myserver.com
Accept: /
Content-Length: 8
Content-Type: application/x-www-form-urlencoded
    &amp;node=fortnite&amp;data={a:   31.00}&amp;apikey=mykey
    Sending..
    Packet sent

    +IPD,422:HTTP/1.1 200 OK
    Server: nginx
    Date: Tue, 02 Oct 2018 21:38:18 GMT
    Content-Type: application/json
    Connection: close
    X-Powered-By: PHP/5.4.16
    Expires: Thu, 19 Nov 1981 08:52:00 GMT
    Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
    Pragm
</code></pre>

<p>Here is a snapshot of the posted data when I used this URL directly in my browser:
<a href="https://i.stack.imgur.com/GjvP0.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/GjvP0.png" alt="My emoncms"></a>
<a href="http://santiapps.com/emoncms/input/post?node=emontx&amp;fulljson=" rel="nofollow noreferrer">http://santiapps.com/emoncms/input/post?node=emontx&amp;fulljson=</a>{"power1":100,"power2":200,"power3":300}&amp;apikey=mykey</p>

<p>￼=========</p>

<h1>Based on jose's suggestion:</h1>

<p>I changed this code to:</p>

<pre><code>void httppost () {
  esp.println("AT+CIPSTART=\"TCP\",\"" + server + "\",80");//start a TCP connection.
  if( esp.find("OK")) {
    Serial.println("TCP connection ready");
  }

//  //CODE USED TO BUILD COMPLETE STRING
  String apiKeyString="apikey="; 
  apiKeyString.concat(EMON_APIKEY); //JOIN PARAMETER LITERAL STRING =&gt; String Object
  //Serial.println(apiKeyString); //THIS IS NOW A STRING OBJECT
  String nodeData="&amp;node=fortnite&amp;data={\"a\":";
  String combinado=apiKeyString+nodeData; //COMBINE BOTH PREVIOUS STRING OBJECTS
  String finalData=combinado + dataString + "}"; //COMBINE STRING OBJECT WITH CHAR[]
  Serial.println("finalData");
  Serial.println(finalData); 
  //unsigned int tamano = strlen(dataString);
//  char postThis[100] = finalData;
//  //ADDING THIS TO POSTREQUEST +finalData; &amp;&amp; changing length for strlen(finalData)

  delay(1000);
  String postRequest="POST " + uri + " HTTP/1.1\r\n"+"Host: " + server + "\r\n" + "Accept: *" + "/" + "*\r\n"+"Content-Length: " + finalData.length() + "\r\n" + "Content-Type: application/x-www-form-urlencoded\r\n"+"\r\n" + finalData;
  Serial.println("postRequest");
  Serial.println(postRequest);
  String sendCmd = "AT+CIPSEND=";//determine the number of caracters to be sent.
</code></pre>

<p>but now I dont even get the HTTP200OK response.  The result is:</p>

<pre><code>loop
31.30
finalData
apikey=myKey&amp;node=fortnite&amp;data={"a":31.30}
postRequest
</code></pre>
 27653: <p>Your Serial monitor output shows the content of the POST as:</p>

<p><code>&amp;amp;node=fortnite&amp;amp;data={a:   31.00}&amp;amp;apikey=mykey</code></p>

<p>I can't tell if the <code>&amp;amp;</code> are actually in your serial monitor, or if your copy/paste did some kind of HTML format attempt, but <code>&amp;amp;</code> is wrong and should be <code>&amp;</code></p>

<p>Your JSON data is not proper JSON</p>

<p><code>{a:   31.00}</code></p>

<p>should be</p>

<p><code>{"a": 31.00}</code></p>

<hr>

<p>Strangely, your serial monitor output also writes <code>Host: www.myserver.com</code>, which doesn't match your code, where <code>server</code> was assigned <code>www.santiapps.com</code>, so that makes it difficult to trust that the serial output you show actually came from the code.</p>
