Bad Request with MKR Wifi 1010

I have been trying to get a POST request on my webserver, however every time I got error 400 - bad request. I use the Arduino MKR Wifi 1010 running WiFiNINA sample code for post requests.

The URL that I would like to execute is https://XXXXXX.azurewebsites.net/measurements.php?deviceid=XXXXXX&value=XXXXXXX"

I have added the domain certificate with the WiFiNINA firmware updater, so maybe the way in which I create the query is wrong?
Would appreciate any help in this matter!

Here is the code that I try to execute:

#include <SPI.h>
#include <WiFiNINA.h>

#include "arduino_secrets.h" 
///////please enter your sensitive data in the Secret tab/arduino_secrets.h
char ssid[] = SECRET_SSID;        // your network SSID (name)
char pass[] = SECRET_PASS;    // your network password (use for WPA, or use as key for WEP)


int deviceID = 99;
int value = 42;
char server[] = "XXXXXX.azurewebsites.net";

int status = WL_IDLE_STATUS;


WiFiSSLClient client;


void setup() {

  Serial.begin(9600);

  while (!Serial) {

    ; // wait for serial port to connect. Needed for native USB port only

  }

  // check for the WiFi module:

  if (WiFi.status() == WL_NO_MODULE) {

    Serial.println("Communication with WiFi module failed!");

    // don't continue

    while (true);

  }

  String fv = WiFi.firmwareVersion();
  if (fv < WIFI_FIRMWARE_LATEST_VERSION) {
    Serial.println("Please upgrade the firmware");
  }
  // attempt to connect to WiFi network:
  while (status != WL_CONNECTED) {
    Serial.print("Attempting to connect to SSID: ");
    Serial.println(ssid);
    // Connect to WPA/WPA2 network. Change this line if using open or WEP network:
    status = WiFi.begin(ssid, pass);
    // wait 10 seconds for connection:
    delay(10000);

  }

  Serial.println("Connected to wifi");
  printWiFiStatus();

  Serial.println("\nStarting connection to server...");

  // if you get a connection, report back via serial:

  if (client.connect(server, 443)) {

    Serial.println("connected to server");

    // Make a HTTP request:

    client.println("POST /measurements.php?deviceid=" + String(deviceID)+ "&value=" + String(value));

    client.println("Host: http://XXXXXX.azurewebsites.net");

    client.println("Connection: close");

    client.println();

}

  else{
    Serial.println("Cannot connect to the server");
  }
}

void loop() {

  // if there are incoming bytes available

  // from the server, read them and print them:

  while (client.available()) {

    char c = client.read();

    Serial.write(c);

  }

  // if the server's disconnected, stop the client:

  if (!client.connected()) {

    Serial.println();

    Serial.println("disconnecting from server.");

    client.stop();

    // do nothing forevermore:

    while (true);

  }
}


void printWiFiStatus() {

  // print the SSID of the network you're attached to:

  Serial.print("SSID: ");

  Serial.println(WiFi.SSID());

  // print your board's IP address:

  IPAddress ip = WiFi.localIP();
  Serial.print("IP Address: ");
  Serial.println(ip);
  long rssi = WiFi.RSSI();
  Serial.print("signal strength (RSSI):");
  Serial.print(rssi);
  Serial.println(" dBm");
}

Quick update:
I realised that I forgot to add the "HTTP/1.1" at the end of the request.
My POST request looks like this right now:

client.println("POST /measurements.php?deviceid=" + String(deviceID)+ "&value=" + String(value) + " HTTP/1.1" );

But I receive:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd">
<HTML><HEAD><TITLE>Length Required</TITLE>
<META HTTP-EQUIV="Content-Type" Content="text/html; charset=us-ascii"></HEAD>
<BODY><h2>Length Required</h2>
<hr><p>HTTP Error 411. The request must be chunked or have a content length.</p>
</BODY></HTML>

Does anyone know how to fix this?

does it work with a browser?
What do you enter in the address bar in the browser?

In general: you are sending a POST request, but you message doesn't contain a http body. So the error message is obvious.

Depending on the script of your webserver and given the URI you have posted, it might be that you have to send a GET Request, as you are appending parameters to the URI

so you MIGHT try

client.println("GET /measurements.php?deviceid=" + String(deviceID)+ "&value=" + String(value) + " HTTP/1.1" );