Status Code -2 Trying POST to API with Arduino MKR WiFi 1010

Hi Guys, I have a litttle experience with arduino and esp's, but now I cant figure this out.

Im trying to do a HTTP POST from a MKR WiFi 1010 to an API Endpoint. Right now I am testing with Reqbin ( https://reqbin.com/post-online ), where I get ["success":"true", 200 OK] with the same payload of my code, with their API POST Request online tool.

I am using the ArduinoHttpClient Simple Post Example, just using <WiFiNINA.h> instead of the original <WiFi101.h>

This is the code:

#include <ArduinoHttpClient.h>
#include <WiFiNINA.h>
#include "arduino_secrets.h"

///////please enter your sensitive data in the Secret tab/arduino_secrets.h
/////// Wifi Settings ///////
char ssid[] = SECRET_SSID;
char pass[] = SECRET_PASS;

char serverAddress[] = "reqbin.com/echo/post/json";  // server address
int port = 8080;

WiFiClient wifi;
HttpClient client = HttpClient(wifi, serverAddress, port);
int status = WL_IDLE_STATUS;

void setup() {
  Serial.begin(9600);
  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, pass);
  }

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

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

void loop() {
  Serial.print("Making POST request to ");
  Serial.println(serverAddress);
  String contentType = "application/x-www-form-urlencoded";
  String postData = "name=Alice&age=12";

  client.post("/", contentType, postData);

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

  Serial.print("Status code: ");
  Serial.println(statusCode);
  Serial.print("Response: ");
  Serial.println(response);

  Serial.println("Wait five seconds");
  delay(5000);
}

And Im getting this into Serial Monitor:

Attempting to connect to Network named: INFINITUM0739
SSID: INFINITUM0739
IP Address: 192.168.1.72
Making POST request to reqbin.com/echo/post/json
Status code: -2
Response: 
Wait five seconds
Making POST request to reqbin.com/echo/post/json
Status code: -2
Response: 
Wait five seconds
Making POST request to reqbin.com/echo/post/json

Could you help me to know, what I am missing?

char serverAddress[] = "reqbin.com";  // server address

 client.post("/echo/post/json", contentType, postData);

Thank you @Juraj ! Now I know the host doesnt have protocols or paths.

My project involves the use of JSON values, so I'm trying to send some JSON values to reqbin.com, and now I get the 301 Status Code (Moved Permantly), but I really dont understand why. Like the previous testing, using the Reqbin JSON POST Tool ( https://reqbin.com/post-online ) example works, but not from my MKR 1010...

This is my actual code:

#include <ArduinoHttpClient.h>
#include <WiFiNINA.h>
#include "arduino_secrets.h"
#include <Arduino_JSON.h>
#include <assert.h>

char ssid[] = SECRET_SSID;
char pass[] = SECRET_PASS;
char serverAddress[] = "reqbin.com";  // server address

WiFiClient wifi;
HttpClient client = HttpClient(wifi, serverAddress);
int status = WL_IDLE_STATUS;

void setup() {
  Serial.begin(9600);
  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, pass);
  }

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

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

void loop() {

  JSONVar myObject;
  myObject["SN"] = (int) 10;
  myObject["F"] = (float) 60.50;
  String jsonData= JSON.stringify(myObject);

  
  Serial.print("Making POST request to ");
  Serial.println(serverAddress);

  String contentType = "application/json";

  client.post("/echo/post/json", contentType, jsonData);
  
  // read the status code and body of the response
  int statusCode = client.responseStatusCode();
  String response = client.responseBody();

  Serial.print("Status code: ");
  Serial.println(statusCode);
  Serial.print("Response: ");
  Serial.println(response);

  //JSONVar responseObject = JSON.parse(response);
  //Serial.println(responseObject);

  Serial.println("Wait  10 secs");
  delay(15000);
}

Testing with httpbin.org/post, it works (Status 200)... Could it be something about reqbin.com server??

HTTP status 200 is success

After some experiments, the problem was that the server that I test on only accepts HTTPS request, so I use:

wifi.connectSSL(serverAddress, 443)

And thats all. Solved