<div dir="ltr"><div><div>Hola,<br><br></div>estuvimos trabajando con Uber en estos días pillando cómo se hace un post a un API. Lo estábamos intentando con ubidots.<br><br></div>Este curl : <span class="">curl -XPOST -H 'Content-Type: application/json;' -H 'X-Auth-Token: AUTH_TOKEN' -d '{"value": 23}' <a href="http://things.ubidots.com/api/v1.6/variables/ID_VARIABLE/values">http://things.ubidots.com/api/v1.6/variables/ID_VARIABLE/values</a></span>
      
      
        
        <span class=""></span><div><br></div><div>en arduino se escribe así:<br><pre>  String url = "<a href="http://things.ubidots.com/api/v1.6/variables/">http://things.ubidots.com/api/v1.6/variables/</a>" ID_VARIABLE "/values";
  http.begin(url);
  http.addHeader("Content-Type", "application/json");
  http.addHeader("X-Auth-Token", AUTH_TOKEN);
  int content_length =0;
  String payload = String("{ \"value\": " + String(millis()/1000) + "}");
  //content_length = payload.length();
  //http.addHeader("Content-Length ", String(content_length));
  int httpCode = http.POST(payload);
  if(httpCode > 0) {
    String payload = http.getString();
    Serial.println(payload);
  }
  else {
    Serial.print("[HTTP] failed, error: ");Serial.println(http.errorToString(httpCode).c_str());
  }
  http.end();</pre></div><div>El código se subió acá <a href="https://github.com/unloquer/postUbidots/">https://github.com/unloquer/postUbidots/</a><br></div><div><br>Por otro lado Uber diseñó unas tarjeticas para el ESP, un nodemcu local :D<br></div><div>Hay que mandarlas a hacer a colcircuitos<br></div><div><img src="http://wiki.unloquer.org/_media/documentacion-proceso/tecnologicos/modulo_node_mcu.png" height="288" width="532"><br><br></div><div>Saludos,<br>-<br></div><div>b<br></div></div>