WiFiS3 - DNS translation

I am on a project that would use Dynamic Electricity Tariffs, where the price is based on availabiity (available in parts of Europe).
I use a Uno R4 WiFi, with the WiFi to get time, as well as the pricing info from a European website, using the WiFIS3 library and the example "WiFIWebClient". Using "WiFIWebClientSSL" yields the same result.
To obtain that price info a HTTP GET request is send.
When I send that request from a browser like FireFox or Safari I receive the pricing table in an XML format as expected.
But when it is send from the UNO R4, following the example code I get an answer :
301 Moved permanently
Location Microsoft-Azure-Application-Gateway/v2, which is a portal located somewhere in Amsterdam.
I have been trying all sorts with no avail.
Doing a CMD-click on the query line gives a web page with the expected result, confirming correctness.
Opening all the sub and subsub libraries to try to find out what happens seems a task too tedious.
It seems to be a DNS problem without being able to define it any closer.
I would be very grateful if anybody would put me on a track towards a solution

In the code herewith I left the example intact. I outcommented the lines that I replaced with the web address and request to use.
But I have a problem leaving my access token in the request; how should we proceed?

Paul Colin

/*  Web client
  This sketch connects to a website (http://www.google.com)
  using the WiFi module.

  created 13 July 2010
  by dlf (Metodo2 srl)
  modified 31 May 2012
  by Tom Igoe
    full UNO R4 WiFi Network documentation:
    https://docs.arduino.cc/tutorials/uno-r4-wifi/wifi-examples#wi-fi-web-client
 */
#include "/Volumes/MacDev/Xcode_playground1/Arduino/libraries/WiFi/src/xxarduino_secrets.h"
#include "WiFiS3.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 keyIndex = 0;           // your network key index number (needed only for WEP)

int status = WL_IDLE_STATUS;
// if you don't want to use DNS (and reduce your sketch size, use the numeric IP instead)
//IPAddress server(74,125,232,128);  // numeric IP for Google (no DNS) NOT OK
//char server[] = "www.google.com";    // name address for Google (using DNS)
char server[] = "web-api.tp.entsoe.eu";
// Initialize the Ethernet client library
// with the IP address and port of the server
// that you want to connect to (port 80 is default for HTTP):
WiFiClient client;

/* -------------------------------------------------------------------------- */
void setup() {
  /* -------------------------------------------------------------------------- */
  //Initialize serial and wait for port to open:
  Serial.begin(115200);
  while (!Serial) {
    ;  // wait for serial port to connect. Needed for native USB port only
  }
  delay(1500);  //because of something strange withn UNO R4
  // 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(4000);  // 4 secs is OK as well.
  }

  printWifiStatus();

  Serial.println("\nStarting connection to server...");
  // if you get a connection, report back via serial:
  if (client.connect(server, 80)) {
    Serial.println("connected to server");
    // Make a HTTP request:
    client.println("GET https://web-api.tp.entsoe.eu/api?documentType=A44&in_Domain=10YBE----------2&out_Domain=10YBE----------2&offset=0&contract_MarketAgreement.type=A01&securityToken=HERE SITS MY TOKEN&periodStart=202601140000&periodEnd=202601150000");

    client.println("Host: web-api.tp.entsoe.eu");
    client.println("Connection: close");
    client.println();
  }
}

/* just wrap the received data up to 80 columns in the serial print*/
/* -------------------------------------------------------------------------- */
void read_response() {
  /* -------------------------------------------------------------------------- */
  uint32_t received_data_num = 0;
  while (client.available()) {
    /* actual data reception */
    char c = client.read();
    /* print data to serial port */
    Serial.print(c);
    /* wrap data to 80 columns*/
    received_data_num++;
    if (received_data_num % 80 == 0) {
      Serial.println();
    }
  }
}

/* -------------------------------------------------------------------------- */
void loop() {
  /* -------------------------------------------------------------------------- */
  read_response();

  // 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);

  // print the received signal strength:
  long rssi = WiFi.RSSI();
  Serial.print("signal strength (RSSI):");
  Serial.print(rssi);
  Serial.println(" dBm");
}

It would help to see the exact response, including all the headers. Post those as <CODE/> (The forum even supports formatting as http)

GET /the_thing?with=these&args HTTP/1.1
Host: whatever
Connection: close

It's probably not the DNS. Your intended request has the bare minimum for HTTP 1.1, but it is actually malformed. If you look at the handily-colored example above, there are three parts to the initial request-line, separated with spaces

  • verb: you got that right
  • path starting with /: you've got the whole URL there, so that's wrong
    • (the request has already made it to the host server, so there's no need to include the protocol://hostname part)
  • HTTP version: it's missing

Once that is fixed, if it still doesn't work, look at all the headers that Firefox or Safari send, and send those too.

a browser does an automatic redirect when it gets an error 301.
use F12 tools in browser to see if it redirects.

and you have to use WiFiSSLClient and port 403.
don't put protocol, server and port into the GET line of the HTTP request

Because I did a last test just before copying the sketch for the forum, I tried without "http/1.1" at the very end of the query. It did not work, but in almost all my tests, http/1.1 was there
I got a second token that I left in the query here below, this allows really to test the thing. I will delete this token next week.
I left 2 queries in the code, one with the URL on board (line 72, the other without (74), to show the different answers
With the code as is as copied below, the answer is:

Attempting to connect to SSID: BB89_2.4_5.0
SSID: BB89_2.4_5.0
IP Address: 192.168.1.36
signal strength (RSSI):-42 dBm

Starting connection to server...

connected to server

301 Moved Permanently

3 01 Moved Permanently


Microsoft-Azure-Application-Gate way/v2 disconnecting from server.

When the URL is left out of the query the same type of message is replied, except that it says 404 Not Found.

With the query from line 72 put in a browser, without GET at the beginning and without http/1.1 at the end, the following answer is replied:

<Publication_MarketDocument xmlns="urn:iec62325.351:tc57wg16:451-3:publicationdocument:7:3">
27732ae821b746ab8ff783ac55a8eb7f
1
A44
<sender_MarketParticipant.marketRole.type>A32</sender_MarketParticipant.marketRole.type>
<receiver_MarketParticipant.mRID codingScheme="A01">10X1001A1001A450</receiver_MarketParticipant.mRID>
<receiver_MarketParticipant.marketRole.type>A33</receiver_MarketParticipant.marketRole.type>
2026-01-29T01:12:03Z
<period.timeInterval>
2026-01-28T23:00Z
</period.timeInterval>
1
<auction.type>A01</auction.type>
A62
<in_Domain.mRID codingScheme="A01">10YBE----------2</in_Domain.mRID>
<out_Domain.mRID codingScheme="A01">10YBE----------2</out_Domain.mRID>
<contract_MarketAgreement.type>A01</contract_MarketAgreement.type>
<currency_Unit.name>EUR</currency_Unit.name>
<price_Measure_Unit.name>MWH</price_Measure_Unit.name>
A03
2026-01-28T23:00Z
PT15M

1
<price.amount>117.77</price.amount>
2
<price.amount>106.46</price.amount>
3
<price.amount>103.82</price.amount>
4
<price.amount>101.91</price.amount>
5
<price.amount>105.8</price.amount>
......
all the 96 quarter prices of the asked day are listed in xml
......
95
<price.amount>103.12</price.amount>
96
<price.amount>93.89</price.amount>
</Publication_MarketDocument>

The code with 2 different queries:
line 12 refers to my own modem and pass

/*  Web client
  This sketch connects to a website (http://www.google.com)
  using the WiFi module.

  created 13 July 2010
  by dlf (Metodo2 srl)
  modified 31 May 2012
  by Tom Igoe
    full UNO R4 WiFi Network documentation:
    https://docs.arduino.cc/tutorials/uno-r4-wifi/wifi-examples#wi-fi-web-client
 */
#include "/Volumes/MacDev/Xcode_playground1/Arduino/libraries/WiFi/src/xxarduino_secrets.h"
#include "WiFiS3.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 keyIndex = 0;           // your network key index number (needed only for WEP)

int status = WL_IDLE_STATUS;
// if you don't want to use DNS (and reduce your sketch size, use the numeric IP instead)
//IPAddress server(74,125,232,128);  // numeric IP for Google (no DNS) NOT OK
//char server[] = "www.google.com";    // name address for Google (using DNS)
char server[] = "web-api.tp.entsoe.eu";
// Initialize the Ethernet client library
// with the IP address and port of the server
// that you want to connect to (port 80 is default for HTTP):
WiFiClient client;

/* -------------------------------------------------------------------------- */
void setup() {
  /* -------------------------------------------------------------------------- */
  //Initialize serial and wait for port to open:
  Serial.begin(115200);
  while (!Serial) {
    ;  // wait for serial port to connect. Needed for native USB port only
  }
  delay(1500);  //because of something strange withn UNO R4
  // 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(4000);  // 4 secs is OK as well.
  }

  printWifiStatus();

  Serial.println("\nStarting connection to server...");
  // if you get a connection, report back via serial:
  if (client.connect(server, 80)) {
    Serial.println("connected to server");
    // Make a HTTP request:
    //    client.println("GET /search?q=arduino HTTP/1.1"); the original example
    //the query here below get a 301 Moved Permanently as answer.
    client.println("GET https://web-api.tp.entsoe.eu/api?documentType=A44&in_Domain=10YBE----------2&out_Domain=10YBE----------2&offset=0&contract_MarketAgreement.type=A01&securityToken=c67dd299-4461-4106-ad5b-836c30efc603&periodStart=202601290000&periodEnd=202601292200 http/1.1");
    https://web-api.tp.entsoe.eu/api?documentType=A44&in_Domain=10YBE----------2&out_Domain=10YBE----------2&offset=0&contract_MarketAgreement.type=A01&securityToken=c67dd299-4461-4106-ad5b-836c30efc603&periodStart=202601290000&periodEnd=202601292200 http/1.1");
    //without the URL in the query a 404 NOT Found is returned
    //client.println("GET /api?documentType=A44&in_Domain=10YBE----------2&out_Domain=10YBE----------2&offset=0&contract_MarketAgreement.type=A01&securityToken=c67dd299-4461-4106-ad5b-836c30efc603&periodStart=202601140000&periodEnd=202601150000 http/1.1");
    client.println("Host: web-api.tp.entsoe.eu");
    client.println("Connection: close");
    client.println();
  }
}

/* just wrap the received data up to 80 columns in the serial print*/
/* -------------------------------------------------------------------------- */
void read_response() {
  /* -------------------------------------------------------------------------- */
  uint32_t received_data_num = 0;
  while (client.available()) {
    /* actual data reception */
    char c = client.read();
    /* print data to serial port */
    Serial.print(c);
    /* wrap data to 80 columns*/
    received_data_num++;
    if (received_data_num % 80 == 0) {
      Serial.println();
    }
  }
}

/* -------------------------------------------------------------------------- */
void loop() {
  /* -------------------------------------------------------------------------- */
  read_response();

  // 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);

  // print the received signal strength:
  long rssi = WiFi.RSSI();
  Serial.print("signal strength (RSSI):");
  Serial.print(rssi);
  Serial.println(" dBm");
}

@Juraj

I totally agree that a browser redirects on a 301. As I tried to explain, my browsers do the job very well. I even doubt if it’s the browsers because there is DNS stuff and memory inside the modems or routers that might do this, even without the browers being aware of it.
The problem is with the code that I put into the Uno R4, where a redirection does not happen.
I’ll try once more with the WiFiClientSSL library, with port 403 and let you know. Anyway, when the address is left out of the query line, the answer is 404, but i will do the test with port 403.

And we tested with "WFiWebClientSSL":
Again, the example WiFiClientSSL was left intact except that i replaced the server address on line 25, replaced the query on line 72 and put the address once more on line 73.
Results:
-With the address in the query the answe ris : 500 Internal server error.
-With the address removed : 404 NOT FOUND
-With the address AND the slash (/) removed: 400 Bad request

I did not put the code inside to spare the internet and the servers.
It sounds like that the address notation needs to be where it sits, right after the GET + space and beginning with either "https://" or "http://"

For now, we can say that : with WiFiWebClientSSL, with https (and port 403) the answer is a 500 Internal Server
and
with WiFIWebClient and exactly the same wording, the answer is 301 Moved Permanently.
Can any conclusion be drawn out of this?

client.println("GET /api?documentType=A44&in_Domain=10YBE----------2&out_Domain=10YBE----------2&offset=0&contract_MarketAgreement.type=A01&securityToken=c67dd299-4461-4106-ad5b-836c30efc603&periodStart=202601290000&periodEnd=202601292200 HTTP/1.1");
    

When in doubt, do it by hand and see what happens:

me@home:~ $ openssl s_client -connect web-api.tp.entsoe.eu:443
CONNECTED(00000003)
depth=2 C = US, ST = New Jersey, L = Jersey City, O = The USERTRUST Network, CN = USERTrust RSA Certification Authority
verify return:1
depth=1 C = GB, ST = Greater Manchester, L = Salford, O = Sectigo Limited, CN = Sectigo RSA Domain Validation Secure Server CA
verify return:1
depth=0 CN = *.tp.entsoe.eu
verify return:1
---
Certificate chain
 0 s:CN = *.tp.entsoe.eu
   i:C = GB, ST = Greater Manchester, L = Salford, O = Sectigo Limited, CN = Sectigo RSA Domain Validation Secure Server CA
 1 s:C = GB, ST = Greater Manchester, L = Salford, O = Sectigo Limited, CN = Sectigo RSA Domain Validation Secure Server CA
   i:C = US, ST = New Jersey, L = Jersey City, O = The USERTRUST Network, CN = USERTrust RSA Certification Authority
 2 s:C = US, ST = New Jersey, L = Jersey City, O = The USERTRUST Network, CN = USERTrust RSA Certification Authority
   i:C = US, ST = New Jersey, L = Jersey City, O = The USERTRUST Network, CN = USERTrust RSA Certification Authority
---
Server certificate
-----BEGIN CERTIFICATE-----
MIIGMzCCBRugAwIBAgIRAK/AWzc6s8jqw5KQmPQhLqAwDQYJKoZIhvcNAQELBQAw
gY8xCzAJBgNVBAYTAkdCMRswGQYDVQQIExJHcmVhdGVyIE1hbmNoZXN0ZXIxEDAO
BgNVBAcTB1NhbGZvcmQxGDAWBgNVBAoTD1NlY3RpZ28gTGltaXRlZDE3MDUGA1UE
AxMuU2VjdGlnbyBSU0EgRG9tYWluIFZhbGlkYXRpb24gU2VjdXJlIFNlcnZlciBD
QTAeFw0yNTA0MjIwMDAwMDBaFw0yNjA1MjMyMzU5NTlaMBkxFzAVBgNVBAMMDiou
dHAuZW50c29lLmV1MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqSuW
mJHNg2vZ80Ru2943H3KpNk0ojl7EyVyY0hephUXzI5M5LRuVrYZOa6FYXxVaZwUn
d57NbZUNITCMH3LJW1N+NvIt6hHmpK3fA1X9Ltp9mKWLBqgJQJnGmVx2jqW+Vwbf
+/XIbJtoJz43W42pW2jBJSKUZa6fbSB53Sg14KGvwuliP7yq0IH35WRCqDFSj8c0
o9lbly/fRxX1ZRtS2WFRk/790JsFm/EDVlnRhba7WvN5rVGyU744uEod1gfLpFxV
N7BbNo3QeGcyz8zzC4QNuLxto4RQq2uc3mCdsQi8nw2Fq/5+KB6aq8GA+cBY2Ko4
wi8tHNGBqo9Nz6lLtQIDAQABo4IC/TCCAvkwHwYDVR0jBBgwFoAUjYxexFStiuF3
6Zv5mwXhuAGNYeEwHQYDVR0OBBYEFD1o82DyTb7vbcXxwIxonnGkGyvAMA4GA1Ud
DwEB/wQEAwIFoDAMBgNVHRMBAf8EAjAAMB0GA1UdJQQWMBQGCCsGAQUFBwMBBggr
BgEFBQcDAjBJBgNVHSAEQjBAMDQGCysGAQQBsjEBAgIHMCUwIwYIKwYBBQUHAgEW
F2h0dHBzOi8vc2VjdGlnby5jb20vQ1BTMAgGBmeBDAECATCBhAYIKwYBBQUHAQEE
eDB2ME8GCCsGAQUFBzAChkNodHRwOi8vY3J0LnNlY3RpZ28uY29tL1NlY3RpZ29S
U0FEb21haW5WYWxpZGF0aW9uU2VjdXJlU2VydmVyQ0EuY3J0MCMGCCsGAQUFBzAB
hhdodHRwOi8vb2NzcC5zZWN0aWdvLmNvbTAnBgNVHREEIDAegg4qLnRwLmVudHNv
ZS5ldYIMdHAuZW50c29lLmV1MIIBfQYKKwYBBAHWeQIEAgSCAW0EggFpAWcAdgCW
l2S/VViXrfdDh2g3CEJ36fA61fak8zZuRqQ/D8qpxgAAAZZc3+fdAAAEAwBHMEUC
IF203kItXb5g0fdhPdtZK3Q2neh+qxn1Aa1qQ4oRujIHAiEA8VvAstBRt5iUNW9v
TYflpSNZNn5sbocX2dDHL6bRW4oAdgAZhtTHKKpv/roDb3gqTQGRqs4tcjEPrs5d
cEEtJUzH1AAAAZZc3+eyAAAEAwBHMEUCIQDOt/suFHJvreE54vSDdkzyk3zRXm9Z
D+bCCw9Hb6HLRAIgCgTJ+72gCJSRcaQ+1+ObuMlce3+VUwKTekV2P60rzYoAdQAO
V5S8866pPjMbLJkHs/eQ35vCPXEyJd0hqSWsYcVOIQAAAZZc3+eEAAAEAwBGMEQC
IBHR2t0rjJpn2i5sg5Ti0jJIh40ps1yZR6MIuzCmSsVfAiAHbsxr7UhgJzwa+7HE
PwLNcDMmgtaHKQion6psBv7eajANBgkqhkiG9w0BAQsFAAOCAQEAxUSkb45h2+MB
HEOemREPbHB9m/7OxqRK+FH3DGYDx1QtdpeCubiV3PjUNsWrLbM4wzS2r79WMjIz
BX69AM4CYeJiWp9YKph/JFU3GqQPg/Jehp0ayQxQl1fZlHEP+P0gStoO4/3m44Ls
V0ZbQjhKyK15V7Z2NXFl0n9xNefnmWUV8xPdq0mJAXMtpXpTfuCi3/S05gIgsuGk
j2PDO9wZm7x28z/VomS5gMOWlxUcgnw8H7EUOu1zcB8Nx1USnimp9UbBy/RL8J7g
7cPhdC4WCkisB/oWtnN10r8bpFG6SH0llQBP7P5Pq4y0z8lsBXeJnx/xJFC6OPSs
cPIYhK3ZmA==
-----END CERTIFICATE-----
subject=CN = *.tp.entsoe.eu

issuer=C = GB, ST = Greater Manchester, L = Salford, O = Sectigo Limited, CN = Sectigo RSA Domain Validation Secure Server CA

---
No client certificate CA names sent
Peer signing digest: SHA512
Peer signature type: RSA
Server Temp Key: ECDH, P-256, 256 bits
---
SSL handshake has read 5352 bytes and written 438 bytes
Verification: OK
---
New, TLSv1.2, Cipher is ECDHE-RSA-AES128-GCM-SHA256
Server public key is 2048 bit
Secure Renegotiation IS supported
Compression: NONE
Expansion: NONE
No ALPN negotiated
SSL-Session:
    Protocol  : TLSv1.2
    Cipher    : ECDHE-RSA-AES128-GCM-SHA256
    Session-ID: 7DC194970704247781650291B5CE1F5F171C505957E566AF6EBB15CFE8114349
    Session-ID-ctx: 
    Master-Key: B0A9F18AE23E6CE5A0D368CAD9A6F28E4297C20D6C806A5689E16B71757C1BD73A73ABA098F1EFA68A96FB7DE4E3B555
    PSK identity: None
    PSK identity hint: None
    SRP username: None
    TLS session ticket lifetime hint: 300 (seconds)
    TLS session ticket:
    0000 - 3c d8 35 cb 6f 33 eb 01-a4 64 24 6d 2c d1 3e b5   <.5.o3...d$m,.>.
    0010 - ff ac 2a 6a cf a6 aa 47-15 50 51 21 9c 3c 0c bb   ..*j...G.PQ!.<..
    0020 - 11 8a 2d a7 3d d7 b9 22-32 d8 12 0a 37 35 be 4b   ..-.=.."2...75.K
    0030 - aa ba ca ab af ef 23 ad-02 8d 63 fc c3 77 8c e6   ......#...c..w..
    0040 - 32 87 59 8f e5 55 c5 17-98 85 fa 21 2b 73 2c 06   2.Y..U.....!+s,.
    0050 - fb a6 5e ca 1d 8b 3c ba-cb 77 c8 0c aa 4c d2 22   ..^...<..w...L."
    0060 - 74 cf 45 8c ab c5 28 65-d7 5a a7 fa a7 5c 8d db   t.E...(e.Z...\..
    0070 - 15 45 a0 47 ec 6d 18 14-47 9d fd 0e 3c 92 a8 37   .E.G.m..G...<..7
    0080 - c7 61 81 25 ca 18 9c 3d-a6 8f 12 b9 08 d0 1b 92   .a.%...=........
    0090 - 79 b3 8a b5 6e 79 1b 3d-44 6e 2a 03 ce 13 a0 bc   y...ny.=Dn*.....
    00a0 - fb b5 64 c9 e5 03 05 2b-be 8d fc 26 a5 b4 9a 9a   ..d....+...&....
    00b0 - 2b 17 9f 19 c7 95 79 26-62 d4 93 e1 f3 53 4a 8b   +.....y&b....SJ.

    Start Time: 1769709018
    Timeout   : 7200 (sec)
    Verify return code: 0 (ok)
    Extended master secret: no
---
GET /api?documentType=A44&in_Domain=10YBE----------2&out_Domain=10YBE----------2&offset=0&contract_MarketAgreement.type=A01&securityToken=c67dd299-4461-4106-ad5b-836c30efc603&periodStart=202601290000&periodEnd=202601292200 HTTP/1.1
Host: web-api.tp.entsoe.eu
Connection: close

HTTP/1.1 200 
Date: Thu, 29 Jan 2026 17:50:21 GMT
Content-Type: text/xml
Transfer-Encoding: chunked
Connection: close
Content-Disposition: inline; filename="Energy_Prices_202601290000-202601292200.xml"
X-Content-Type-Options: nosniff
X-XSS-Protection: 0
vary: accept-encoding
Strict-Transport-Security: max-age=15724800; includeSubDomains

eee
<?xml version="1.0" encoding="utf-8"?>
  <Publication_MarketDocument xmlns="urn:iec62325.351:tc57wg16:451-3:publicationdocument:7:3">
    <mRID>4eead6d5bece453abae72f6972740713</mRID>
    <revisionNumber>1</revisionNumber>
    <type>A44</type>
    <sender_MarketParticipant.mRID codingScheme="A01">10X1001A1001A450</sender_MarketParticipant.mRID>
    <sender_MarketParticipant.marketRole.type>A32</sender_MarketParticipant.marketRole.type>
    <receiver_MarketParticipant.mRID codingScheme="A01">10X1001A1001A450</receiver_MarketParticipant.mRID>
    <receiver_MarketParticipant.marketRole.type>A33</receiver_MarketParticipant.marketRole.type>
    <createdDateTime>2026-01-29T17:50:21Z</createdDateTime>
    <period.timeInterval>
      <start>2026-01-28T23:00Z</start>
      <end>2026-01-29T23:00Z</end>
    </period.timeInterval>
      <TimeSeries>
        <mRID>1</mRID>
        <auction.type>A01</auction.type>
        <businessType>A62</businessType>
        <in_Domain.mRID codingScheme="A01">10YBE----------2</in_Domain.mRID>
        <out_Domain.mRID codingScheme="A01">10YBE----------2</out_Domain.mRID>
        <contract_MarketAgreement.type>A01</contract_MarketAgreement.type>
        <currency_Unit.name>EUR</currency_Unit.name>
        <price_Measure_Unit.name>MWH</price_Measure_Unit.name>
        <curveType>A03</curveType>
          <Period>
            <timeInterval>
              <start>2026-01-28T23:00Z</start>
              <end>2026-01-29T23:00Z</end>
            </timeInterval>
            <resolution>PT15M</resolution>
              <Point>
                <position>1</position>
                  <price.amount>117.77</price.amount>
              </Point>
              <Point>
                <position>2</position>
                  <price.amount>106.46</price.amount>
              </Point>
              <Point>
                <position>3</position>
                  <price.amount>103.82</price.amount>
              </Point>
              <Point>
                <position>4</position>
                  <price.amount>101.91</price.amount>
              </Point>
              <Point>
                <position>5</position>
                  <price.amount>105.8</price.amount>
              </Point>
              <Point>
                <position>6</position>
                  <price.amount>104.03</price.amount>
              </Point>
              <Point>
                <position>7</position>
                  <price.amount>104.99</price.amount>
              </Point>
              <Point>
                <position>8</position>
                  <price.amount>102.43</price.amount>
              </Point>
              <Point>
                <position>9</position>
                  <price.amount>104.5</price.amount>
              </Point>
              <Point>
                <position>10</position>
                  <price.amount>104.08</price.amount>
              </Point>
              <Point>
                <position>11</position>
                  <price.amount>101.95</price.amount>
              </Point>
              <Point>
                <position>12</position>
                  <price.amount>100.23</price.amount>
              </Point>
              <Point>
                <position>13</position>
                  <price.amount>100.03</price.amount>
              </Point>
              <Point>
                <position>14</position>
                  <price.amount>100</price.amount>
              </Point>
              <Point>
                <position>15</position>
                  <price.amount>98.48</price.amount>
              </Point>
              <Point>
                <position>16</position>
                  <price.amount>96.59</price.amount>
              </Point>
              <Point>
                <position>17</position>
        
1000
          <price.amount>98.35</price.amount>
              </Point>
              <Point>
                <position>18</position>
                  <price.amount>97.55</price.amount>
              </Point>
              <Point>
                <position>19</position>
                  <price.amount>98.22</price.amount>
              </Point>
              <Point>
                <position>20</position>
                  <price.amount>101.72</price.amount>
              </Point>
              <Point>
                <position>21</position>
                  <price.amount>100.78</price.amount>
              </Point>
              <Point>
                <position>22</position>
                  <price.amount>101.35</price.amount>
              </Point>
              <Point>
                <position>23</position>
                  <price.amount>107.52</price.amount>
              </Point>
              <Point>
                <position>24</position>
                  <price.amount>106.85</price.amount>
              </Point>
              <Point>
                <position>25</position>
                  <price.amount>103.9</price.amount>
              </Point>
              <Point>
                <position>26</position>
                  <price.amount>112.54</price.amount>
              </Point>
              <Point>
                <position>27</position>
                  <price.amount>123.91</price.amount>
              </Point>
              <Point>
                <position>28</position>
                  <price.amount>139.94</price.amount>
              </Point>
              <Point>
                <position>29</position>
                  <price.amount>132.47</price.amount>
              </Point>
              <Point>
                <position>30</position>
                  <price.amount>149.5</price.amount>
              </Point>
              <Point>
                <position>31</position>
                  <price.amount>160.72</price.amount>
              </Point>
              <Point>
                <position>32</position>
                  <price.amount>164.28</price.amount>
              </Point>
              <Point>
                <position>33</position>
                  <price.amount>163.58</price.amount>
              </Point>
              <Point>
                <position>34</position>
                  <price.amount>165.62</price.amount>
              </Point>
              <Point>
                <position>35</position>
                  <price.amount>167.25</price.amount>
              </Point>
              <Point>
                <position>36</position>
                  <price.amount>164.14</price.amount>
              </Point>
              <Point>
                <position>37</position>
                  <price.amount>173.07</price.amount>
              </Point>
              <Point>
                <position>38</position>
                  <price.amount>166.21</price.amount>
              </Point>
              <Point>
                <position>39</position>
                  <price.amount>167.51</price.amount>
              </Point>
              <Point>
                <position>40</position>
                  <price.amount>158.95</price.amount>
              </Point>
              <Point>
                <position>41</position>
                  <price.amount>172.74</price.amount>
              </Point>
              <Point>
                <position>42</position>
                  <price.amount>163.72</price.amount>
              </Point>
              <Point>
                <position>43</position>
                  <price.amount>158.04</price.amount>
              </Point>
              <Point>
                <position>44</position>
                  <price.amount>149.63</price.amount>
              </Point>
              <Point>
                <position>45</position>
                  <price.amount>159.01</price.amount>
              </Point>
              <Point>
                <position>46</position>
                  <price.amount>153.33</price.amount>
              </Point>
 
ff8
             <Point>
                <position>47</position>
                  <price.amount>150.65</price.amount>
              </Point>
              <Point>
                <position>48</position>
                  <price.amount>141.58</price.amount>
              </Point>
              <Point>
                <position>49</position>
                  <price.amount>148.93</price.amount>
              </Point>
              <Point>
                <position>50</position>
                  <price.amount>143.91</price.amount>
              </Point>
              <Point>
                <position>51</position>
                  <price.amount>141.57</price.amount>
              </Point>
              <Point>
                <position>52</position>
                  <price.amount>137.25</price.amount>
              </Point>
              <Point>
                <position>53</position>
                  <price.amount>149.57</price.amount>
              </Point>
              <Point>
                <position>54</position>
                  <price.amount>141.14</price.amount>
              </Point>
              <Point>
                <position>55</position>
                  <price.amount>140.24</price.amount>
              </Point>
              <Point>
                <position>56</position>
                  <price.amount>133.78</price.amount>
              </Point>
              <Point>
                <position>57</position>
                  <price.amount>140.77</price.amount>
              </Point>
              <Point>
                <position>58</position>
                  <price.amount>140.22</price.amount>
              </Point>
              <Point>
                <position>59</position>
                  <price.amount>139.15</price.amount>
              </Point>
              <Point>
                <position>60</position>
                  <price.amount>141.14</price.amount>
              </Point>
              <Point>
                <position>61</position>
                  <price.amount>139.18</price.amount>
              </Point>
              <Point>
                <position>62</position>
                  <price.amount>138.8</price.amount>
              </Point>
              <Point>
                <position>63</position>
                  <price.amount>140</price.amount>
              </Point>
              <Point>
                <position>64</position>
                  <price.amount>146.1</price.amount>
              </Point>
              <Point>
                <position>65</position>
                  <price.amount>138.86</price.amount>
              </Point>
              <Point>
                <position>66</position>
                  <price.amount>144.41</price.amount>
              </Point>
              <Point>
                <position>67</position>
                  <price.amount>146.08</price.amount>
              </Point>
              <Point>
                <position>68</position>
                  <price.amount>154.55</price.amount>
              </Point>
              <Point>
                <position>69</position>
                  <price.amount>146.57</price.amount>
              </Point>
              <Point>
                <position>70</position>
                  <price.amount>149.34</price.amount>
              </Point>
              <Point>
                <position>71</position>
                  <price.amount>153.76</price.amount>
              </Point>
              <Point>
                <position>72</position>
                  <price.amount>157.3</price.amount>
              </Point>
              <Point>
                <position>73</position>
                  <price.amount>151.52</price.amount>
              </Point>
              <Point>
                <position>74</position>
                  <price.amount>153.72</price.amount>
              </Point>
              <Point>
                <position>75</position>
                  <price.amount>153.11</price.amount>
              </Point>
              <Point>
                <position>76</position>
  
b6c
                <price.amount>154.19</price.amount>
              </Point>
              <Point>
                <position>77</position>
                  <price.amount>150.54</price.amount>
              </Point>
              <Point>
                <position>78</position>
                  <price.amount>148.71</price.amount>
              </Point>
              <Point>
                <position>79</position>
                  <price.amount>149.07</price.amount>
              </Point>
              <Point>
                <position>80</position>
                  <price.amount>139.67</price.amount>
              </Point>
              <Point>
                <position>81</position>
                  <price.amount>140.2</price.amount>
              </Point>
              <Point>
                <position>82</position>
                  <price.amount>128.79</price.amount>
              </Point>
              <Point>
                <position>83</position>
                  <price.amount>119.61</price.amount>
              </Point>
              <Point>
                <position>84</position>
                  <price.amount>111.97</price.amount>
              </Point>
              <Point>
                <position>85</position>
                  <price.amount>121.45</price.amount>
              </Point>
              <Point>
                <position>86</position>
                  <price.amount>114.23</price.amount>
              </Point>
              <Point>
                <position>87</position>
                  <price.amount>109.14</price.amount>
              </Point>
              <Point>
                <position>88</position>
                  <price.amount>104.72</price.amount>
              </Point>
              <Point>
                <position>89</position>
                  <price.amount>113.19</price.amount>
              </Point>
              <Point>
                <position>90</position>
                  <price.amount>108.85</price.amount>
              </Point>
              <Point>
                <position>91</position>
                  <price.amount>109.09</price.amount>
              </Point>
              <Point>
                <position>92</position>
                  <price.amount>105.48</price.amount>
              </Point>
              <Point>
                <position>93</position>
                  <price.amount>110.84</price.amount>
              </Point>
              <Point>
                <position>94</position>
                  <price.amount>100.67</price.amount>
              </Point>
              <Point>
                <position>95</position>
                  <price.amount>103.12</price.amount>
              </Point>
              <Point>
                <position>96</position>
                  <price.amount>93.89</price.amount>
              </Point>
          </Period>
      </TimeSeries>
  </Publication_MarketDocument>
0

closed
me@home:~ $ 

So the response with the 301 didn't actually look more like this, as shown with this curl?

$ curl -i http://web-api.tp.entsoe.eu:80/api

(I am going to cheat a little and format the response headers and body separately)

HTTP/1.1 301 Moved Permanently
Server: Microsoft-Azure-Application-Gateway/v2
Date: Thu, 29 Jan 2026 18:03:59 GMT
Content-Type: text/html
Content-Length: 195
Connection: keep-alive
Location: https://web-api.tp.entsoe.eu/api
<html>
<head><title>301 Moved Permanently</title></head>
<body>
<center><h1>301 Moved Permanently</h1></center>
<hr><center>Microsoft-Azure-Application-Gateway/v2</center>
</body>
</html>

With plain WiFiClient connect-ing on port 80, the response is 301, and the Location header says to try the same path using https:// instead. That is the operational part of the response. The descriptive parts include the name "Microsoft-Azure-Application-Gateway/v2" as both the Server header and in the HTML. That is the exact response that would help to diagnose your problem.

Switching to what should be WiFiSSLClient on what should be port 443, not "403" (an unfortunate typo in a reply you got), note that the protocol at the end, the third part of the request-line that you tried each time was http/1.1 lowercase. In addition the openssl example posted above using https, here's how to do it manually with http, where the results are easier to see

$ telnet web-api.tp.entsoe.eu 80
Trying 20.23.37.29...
Connected to tp.entsoe.eu.
Escape character is '^]'.
GET /api http/1.1
<html>
<head><title>404 Not Found</title></head>
<body>
<center><h1>404 Not Found</h1></center>
<hr><center>Microsoft-Azure-Application-Gateway/v2</center>
</body>
</html>
Connection closed by foreign host.

You don't get past that first line; the 404 response and closure is immediate. Interestingly, you don't even get response headers, because what you are sending is not HTTP. HTTP/1.1 uppercase is what is required.

So that's why you didn't get headers originally: because HTTP/1.1 was missing.

$ telnet web-api.tp.entsoe.eu 80
Trying 20.23.37.29...
Connected to tp.entsoe.eu.
Escape character is '^]'.
GET https://web-api.tp.entsoe.eu/api?documentType
<html>
<head><title>301 Moved Permanently</title></head>
<body>
<center><h1>301 Moved Permanently</h1></center>
<hr><center>Microsoft-Azure-Application-Gateway/v2</center>
</body>
</html>
Connection closed by foreign host.

A not-helpful response, but you were not following the protocol attempting to perform HTTP manually.

Many thanks at kenb4 and van der Decken and Juraj for your time and interesting replies. I went through all the replies I got.
Because I still don't get my data on Arduino IDE, I summarized a bit about the prefixes and suffixes on that query line and other stuff that can be eliminated.
But before all this, I want to draw your attention about a rather strange phenomenon that I happened to find :
Whit the pointer on the query line and Cmd pressed, that line gets blue and a small popup : " follow link cmd + click" or one as shown below.
WHEN A CLICK IS DONE (with cmd pressed) A NEW WINDOW APPEARS WITH EXACTLY THE INFORMATION REQUESTED IN xml.

I did some tests and this works, with or without the "GET" at the beginning and "http/1.1" at the end.
To be sure that nothing else was left, I loaded BLINK in the UNO R4 and pasted that query link in the BLINK code. It works also from there, thus without the WiFiS3I.h lib.
This works in a MacBook2015 with IDE 2.3.6 as as in new MacBook M4 with IDE 2.3.7, apparently only inside Arduino IDE.
Anybody knows who does this magic? How can we get this to work in a sketch? It seems to be something from the IDE

  1. without "GET HTTP://web..." or "GET HTTPS://web..." at the start the response is always 400 Bad request, HTTP in upper- or lowercase, no matter.
  2. as soon as the prefix contains" GET http://web... etc" the response is 301
  3. ending with http/1.1 at the end does not make any difference. I even tried by putting some rubble at the end, like "ht12345cd", the answers is always 301 when the prefix as here above is present.
  4. Using "web-api.tp.entsoe.eu" or "external-api.tp.entsoe.eu" as advised by the entsoe people does not make a. difference.
  5. I understood that the 403 instead of 443 from Juraj was just a typing glitch
  6. the rest of the request line cannot be changed even by one character, except for the dates. This is similar wit what happens when sent from a browser or Terminal

As written before, the request works also fine in Terminal and in several browsers, but not yet in an Arduino IDE sketch.
How do we get there?

in the sketch you don't write
GET https://server/url?parameters HTTP/1.1
but
GET /url?parameters HTTP/1.1

the https is given by use of port 443
so you first connect to a port with client.connect(server, 443);
and then you send the HTTP protocol request with client.println as
"GET /url?parameters HTTP/1.1" as first line
on the following lines you send the http protocol headers

This is an entirely unrelated feature to view URLs that happen to source code, or any other text in the editor. For example, someone has a comment at the top of the sketch with their website address; you can cmd-click that and see it. That has nothing to do with getting the sketch to fetch content from that URL. Easy to replicate: put an URL in an empty sketch

void setup() {
  http://google.com

}

void loop() {
  // put your main code here, to run repeatedly:

}

Not shown here in the forum, but while applying syntax highlighting, the URL is detected and underlined in the IDE. (At the bottom left corner of your screenshot above, the ET for GET is not underlined; it starts at the HTTP. Separately, the code hint thinks HTTP is a variable; it's confused.) When you cmd-click it, the IDE grabs the text of the URL -- URLs don't have spaces in them, so it grabs the whole "word" -- and then passes that to your default browser to open, as if you typed it manually.

That's the "magic" there.

I am pretty sure that I tested every possible combination of WiFiSSLClient and WiFiClient, HTTP and HTTPS in upper- and lowercase, port 80 and 443.
The only compulsary http headers is HOST, so the requirements of the last line of your reply are fulfilled.
I will test once more with the query line that is written in green characters in you reply.

I'll be back with the results (hoping good ones).