MKR1000 GET request

Hello, I’m trying to make a GET request with MKR1000 board using the SimpleGet example:

#include <ArduinoHttpClient.h>
#include <WiFi101.h>
#include <SPI.h>

#include "arduino_secrets.h"

/////// Wifi Settings ///////
char ssid[] = SECRET_SSID;
//char pass[] = SECRET_PASS;

char serverAddress[] = "";  // server address
int port = 80;

WiFiClient wifi;
HttpClient client = HttpClient(wifi, serverAddress, port);
int status = WL_IDLE_STATUS;
String response;
int statusCode = 0;

void setup() {
  while ( status != WL_CONNECTED) {
    Serial.print("Attempting to connect to Network named: ");
    Serial.println(ssid);                   // print the network name (SSID);

    // Connect to WPA/WPA2 network:
    status = WiFi.begin(ssid);

  // print the SSID of the network you're attached to:
  Serial.print("SSID: ");

  // print your WiFi shield's IP address:
  IPAddress ip = WiFi.localIP();
  Serial.print("IP Address: ");

void loop() {
  Serial.println("making GET request");


  // read the status code and body of the response
  statusCode = client.responseStatusCode();
  response = client.responseBody();

  Serial.print("Status code: ");
  Serial.print("Response: ");
  Serial.println("Wait five seconds");

And I get the following message:

SSID: mywifi
IP Address: myIP
making GET request
Status code: -2
Wait five seconds

I also tried with just “” in the address and I get a -3 status code. I have tried some other examples but I’m unable to make an http, post or get request. Do you have some advice?

Thank you for your help.

This example may help you

Notice the use of the CLIENT commands.

A slightly different example here using server status

If you read the whole page you will see that GET and PUT are not used directly.