user3364: I'm new to the Arduino Yun and I'm trying to convert a sketch written for the Arduino Uno with a Ethernet Shield. The sketch does HTTP posts to Azure Mobile Services.
I've added in the Bridge.h and YunClient.h libraries in place of the Ethernet.h one for the Uno.
My modified sketch compiles, however, I don't think the http posts are working. I don't see my table updating in Azure.

    /*
    ** This sample Arduino sketch uploads telemetry data to Azure Mobile Services
    ** See the full article here: http://hypernephelist.com/2014/07/11/arduino-uno-azure-mobile-services.html
    **
    ** Thomas Conté @tomconte
    */
#include <Bridge.h>
#include <YunClient.h>
//#include <Ethernet.h> // removed as not used by Yun
#include <SPI.h>

// not sure if these libraries are required?
#include <HttpClient.h>
#include <Process.h>

// Ethernet shield MAC address (sticker in the back)
//byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
// 90:A2:DA:F8:28:38

// Azure Mobile Service address
// You can find this in your service dashboard
const char *server = "myhost.azure-mobile.net";

// Azure Mobile Service table name
// The name of the table you created
const char *table_name = "my_data";

// Azure Mobile Service Application Key
// You can find this key in the 'Manage Keys' menu on the dashboard
const char *ams_key = "HJRxFXXXXXXXXXXXXXXXXXXXNQoMcXXXXXXx99";

//EthernetClient client;
YunClient client;

char buffer[64];

/*
** Send an HTTP POST request to the Azure Mobile Service data API
*/

void send_request(int value)
{
  Serial.println("\nconnecting...");

    Serial.print("sending ");
    Serial.println(value);

    // POST URI
    sprintf(buffer, "POST /tables/%s HTTP/1.1", table_name);
    client.println(buffer);

    // Host header
    sprintf(buffer, "Host: %s", server);
    client.println(buffer);

    // Azure Mobile Services application key
    sprintf(buffer, "X-ZUMO-APPLICATION: %s", ams_key);
    client.println(buffer);

    // JSON content type
    client.println("Content-Type: application/json");

    // POST body
    sprintf(buffer, "{\"value\": %d}", value);

    // Content length
    client.print("Content-Length: ");
    client.println(strlen(buffer));

    // End of headers
    client.println();

    // Request body
    client.println(buffer);

}

/*
** Wait for response
*/

void wait_response()
{
  while (!client.available()) {
    if (!client.connected()) {
      return;
    }
  }
}


/*
** Read the response and dump to serial
*/

void read_response()
{
  bool print = true;

  while (client.available()) {
    char c = client.read();
    // Print only until the first carriage return
    if (c == '\n')
      print = false;
    if (print)
      Serial.print(c);
  }
}

/*
** Close the connection
*/

void end_request()
{
  client.stop();
}

/*
** Arduino Setup
*/

void setup()
{
Serial.begin(9600);
Serial.println("Starting Bridge");
Bridge.begin();

}

/*
** Arduino Loop
*/

void loop()
{
  int val = analogRead(A0);

  send_request(val);
  wait_response();
  read_response();
  end_request();

  delay(1000);
}


user71575: (Updating answer from comments.)
The OP answered their own question, they missed the code to connect to the web service
if (client.connect(server, 80))

3364: <p>I'm new to the Arduino Yun and I'm trying to convert a sketch written for the Arduino Uno with a Ethernet Shield. The sketch does HTTP posts to Azure Mobile Services.</p>

<p>I've added in the <code>Bridge.h</code> and <code>YunClient.h</code> libraries in place of the <code>Ethernet.h</code> one for the Uno.</p>

<p>My modified sketch compiles, however, I don't think the http posts are working. I don't see my table updating in Azure.

    /*
    ** This sample Arduino sketch uploads telemetry data to Azure Mobile Services
    ** See the full article here: <a href="http://hypernephelist.com/2014/07/11/arduino-uno-azure-mobile-services.html" rel="nofollow noreferrer">http://hypernephelist.com/2014/07/11/arduino-uno-azure-mobile-services.html</a>
    **
    ** Thomas Conté @tomconte
    */</p>

<pre class="lang-cpp prettyprint-override"><code>#include &lt;Bridge.h&gt;
#include &lt;YunClient.h&gt;
//#include &lt;Ethernet.h&gt; // removed as not used by Yun
#include &lt;SPI.h&gt;

// not sure if these libraries are required?
#include &lt;HttpClient.h&gt;
#include &lt;Process.h&gt;

// Ethernet shield MAC address (sticker in the back)
//byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
// 90:A2:DA:F8:28:38

// Azure Mobile Service address
// You can find this in your service dashboard
const char *server = "myhost.azure-mobile.net";

// Azure Mobile Service table name
// The name of the table you created
const char *table_name = "my_data";

// Azure Mobile Service Application Key
// You can find this key in the 'Manage Keys' menu on the dashboard
const char *ams_key = "HJRxFXXXXXXXXXXXXXXXXXXXNQoMcXXXXXXx99";

//EthernetClient client;
YunClient client;

char buffer[64];

/*
** Send an HTTP POST request to the Azure Mobile Service data API
*/

void send_request(int value)
{
  Serial.println("\nconnecting...");

    Serial.print("sending ");
    Serial.println(value);

    // POST URI
    sprintf(buffer, "POST /tables/%s HTTP/1.1", table_name);
    client.println(buffer);

    // Host header
    sprintf(buffer, "Host: %s", server);
    client.println(buffer);

    // Azure Mobile Services application key
    sprintf(buffer, "X-ZUMO-APPLICATION: %s", ams_key);
    client.println(buffer);

    // JSON content type
    client.println("Content-Type: application/json");

    // POST body
    sprintf(buffer, "{\"value\": %d}", value);

    // Content length
    client.print("Content-Length: ");
    client.println(strlen(buffer));

    // End of headers
    client.println();

    // Request body
    client.println(buffer);

}

/*
** Wait for response
*/

void wait_response()
{
  while (!client.available()) {
    if (!client.connected()) {
      return;
    }
  }
}


/*
** Read the response and dump to serial
*/

void read_response()
{
  bool print = true;

  while (client.available()) {
    char c = client.read();
    // Print only until the first carriage return
    if (c == '\n')
      print = false;
    if (print)
      Serial.print(c);
  }
}

/*
** Close the connection
*/

void end_request()
{
  client.stop();
}

/*
** Arduino Setup
*/

void setup()
{
Serial.begin(9600);
Serial.println("Starting Bridge");
Bridge.begin();

}

/*
** Arduino Loop
*/

void loop()
{
  int val = analogRead(A0);

  send_request(val);
  wait_response();
  read_response();
  end_request();

  delay(1000);
}
</code></pre>
 71575: <p>(Updating answer from comments.)</p>
<p>The OP answered their own question, they missed the code to connect to the web service</p>
<p><code>if (client.connect(server, 80))</code></p>
