Data from Core to Emoncms (private server)

Hi everybody!
I’m using a Spark Core to send data to an Emoncms private database:
everything was going right
but unfortunately I deleted the sketch (damn!).
Now I’m not able to write another one working,
I’m sure the one I’m struggling around is full of stupid mistakes…I can’t see.
And ok, sending data via browser (http://xxxxxxxxxx.noip.me/emoncms/input/post.json?node=1&json={power:150,light:78}&apikey=445d983840daa4288430fa9c9d7434cc)
or curl works fine.

So…what?
Please, anyone can help?

My sketch:

  // This #include statement was automatically added by the Particle IDE.
#include "HttpClient/HttpClient.h"

// This #include statement was automatically added by the Particle IDE.
#include "spark-dallas-temperature/spark-dallas-temperature.h"

// This #include statement was automatically added by the Particle IDE.
#include "OneWire/OneWire.h"

#define ONE_WIRE_BUS D2

#define DEVICE_ID "51ff6c065082554916540123"
#define TOKEN "7327a3859afda46ba2eb1d326b7b1d1e1251123f"

OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensor(&oneWire);
 
double temperature = 0.0;
int light = 0;
int humidity=0;

HttpClient http;
http_header_t headers[] = {
      { "Content-Type", "application/json" },
      { "X-Auth-Token" , TOKEN },
    { NULL, NULL } // NOTE: Always terminate headers will NULL
};

http_request_t request;
http_response_t response;


void setup() {

 Particle.variable("temp", &temperature, DOUBLE);
 Particle.variable("light", &light, INT);
 sensor.begin();
 sensor.setResolution(12);
    request.hostname = "xxxxxxxxxx.noip.me/emoncms";
   //     request.ip = {192,168,1,104};

    request.port = 80;
    
    Serial.begin(9600);
}

void loop() {
 sensor.requestTemperatures();
 temperature= sensor.getTempCByIndex(0);
 light = analogRead(A0);
 humidity=light/10;
 
   Serial.println(temperature);
  Serial.println(light);

 
// request.path = "/input/post.json?apikey=445d983840daa4288430fa9c9d7434cc&node=1&json=";
  request.path = "/input/post.json?apikey=445d983840daa4288430fa9c9d7434cc&node=1&json={power:122,light:30}";

// request.body = "{power:122,light:30}";
 
  //request.body = "{\"power\":" + String(light) + "}";
// http://192.168.1.104/emoncms/input/post.json?node=1&json={power:150,light:78}&apikey=445d983840daa4288430fa9c9d7434cc
 http.post(request, response, headers);
 //Serial.printl(request.body);
 //Serial.println("000000");
  //Serial.println(response.status); //For debug only
  Serial.println(humidity);
//  Serial.println(response.body);
  
  delay(20000);
 }

Try changing this:

request.hostname = "sXXXXXXXXf.noip.me/emoncms";

to this:

request.hostname = "sXXXXXXXXf.noip.me";

And change this:

request.path = "/input/post.json?apikey=445d983840daa4288430fa9c9d7434cc&node=1&json={power:122,light:30}";

to this:

request.path = "/emoncms/input/post.json?apikey=445d983840daa4288430fa9c9d7434cc&node=1&json={power:122,light:30}";

Thanks Dougal!
I think the error was in http_header_t definition,

{ "Accept" , "*/*"},

was missing.
Below code works (it is a simplified version):

#include "application.h"
#include "HttpClient/HttpClient.h"
    
#define TOKEN "7327a3859afda46ba2eb1d326b7b1d1e1251922f"
unsigned int nextTime = 0;    // Next time to contact the server

    HttpClient http;
// Headers currently need to be set at init, useful for API keys etc.
http_header_t headers[] = {
    { "Content-Type", "application/json" },
    { "X-Auth-Token" , TOKEN },
    { "Accept" , "*/*"},
    { NULL, NULL } // NOTE: Always terminate headers will NULL
};

http_request_t request;
http_response_t response;

void setup() {
    Serial.begin(9600);
}

void loop() {
    if (nextTime > millis()) {
        return;
    }

    Serial.println();
    Serial.println("Application>\tStart of Loop.");
    request.hostname = "xxxxxxxxxx.noip.me";
    request.port = 80;
    request.path = "/emoncms/input/post.json?apikey=445d983840daa4288430fa9c9d7434cc&node=1&json={power:99,light:98}";

    http.post(request, response, headers);
    Serial.print("Application>\tResponse status: ");
    Serial.println(response.status);

    Serial.print("Application>\tHTTP Response Body: ");
    Serial.println(response.body);

    nextTime = millis() + 10000;
}

I also verified:
declaring

request.hostname = "xxxxxxxxxx.noip.me/emoncms";
request.port = 80;
request.path = "/input/post.json?apikey=445d983840daa4288430fa9c9d7434cc&node=1&json={power:99,light:98}";

or

request.hostname = "xxxxxxxxxx.noip.me";
request.port = 80;
request.path = "/emoncms/input/post.json?apikey=445d983840daa4288430fa9c9d7434cc&node=1&json={power:99,light:98}";

works the same way!