# Basic GET request WifiNINA

**URL:** <https://forum.arduino.cc/t/basic-get-request-wifinina/1130446>\
**Category:** Networking, Protocols, and Devices\
**Created:** [May 24, 2023, 9:49am UTC](https://forum.arduino.cc/t/basic-get-request-wifinina/1130446 "2023-05-24T09:49:22Z")\
**Posts on this page:** 7\
**Page:** 2

<div class="post-metadata">

**Author:** ![darthvader072](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/darthvader072/32/527671_2.png) [@darthvader072](https://forum.arduino.cc/u/darthvader072)\
**Post date:** [May 26, 2023, 9:51am UTC](https://forum.arduino.cc/t/basic-get-request-wifinina/1130446/21 "2023-05-26T09:51:03Z")

</div>

So weird I can't make the most basic GET-request, without authentication or JSON.  
I just try to call an URL, which works great with Postman / Browser, but not with Arduino; even witht the tons of examples.

---

<div class="post-metadata">

**Author:** ![darthvader072](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/darthvader072/32/527671_2.png) [@darthvader072](https://forum.arduino.cc/u/darthvader072)\
**Post date:** [May 26, 2023, 10:15am UTC](https://forum.arduino.cc/t/basic-get-request-wifinina/1130446/22 "2023-05-26T10:15:35Z")

</div>

Sorry I found something.

 ![Scherm­afbeelding 2023-05-26 om 12.10.34](https://europe1.discourse-cdn.com/arduino/original/4X/0/e/d/0ed30911771cd40b830e84381e7fb3da5a053286.png)

Apparently there were issues with the Host header..  
I played with it, and added it now before making the GET-request

Now I get a 200 result and no error in the external log file, but it loads the html page source?

```arduino
Starting connection to server...
connected to server
HTTP/1.1 200 OK
Host:
Server: MADRIX
Last-Modified: Fri, 26 May 2023 12:08:18 GMT
Content-Type: text/html
Content-Length: 22338
Cache-Control: max-age=0

<!doctype html>
<html lang="eng">
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<meta http-equiv="expires" content="0">
	<meta name="robots" content="noindex, nofollow">
	<title>MADRIX 5 on Dynamic</title>
	<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
	<link rel="apple-touch-icon-precomposed" href="apple-touch-icon.png">
	<link rel="stylesheet" type="text/css" href="style.css">
	<script type="text/javascript" src="madrixremote.js"></script>
</head>
<body onload="initGui()">
	<noscript><strong>JavaScript is required to use this website for the MADRIX HTTP Remote Control! Please enable it in order to continue.</strong></noscript>
	<header>
		<svg class="mlogo" viewBox="0 0 1134 426">
			<desc>MADRIX Lighting Control</desc>
			<g class="mlogo-icon">
				<path d="M164.766,225.21c-8.055,-2.435 -15.73,-4.871 -23.034,-7.498l0,15.563c7.868,2.441 16.292,4.687 25.279,6.75c27.712,6.56 60.475,11.625 99.977,14.621c5.246,0.562 10.862,0.939 16.477,1.312l0,-8.433c-5.615,-0.75 -11.231,-1.317 -16.477,-2.061c-40.625,-5.252 -74.138,-12 -102.222,-20.254Z"/>
				<path d="M153.155,250.521c-3.93,-0.934 -7.675,-1.873 -11.423,-2.811l0,36.558l141.733,0l0,-16.309c-5.617,-0.375 -11.231,-0.748 -16.477,-1.125c-44.744,-3.377 -82.002,-8.812 -113.833,-16.313Z"/>
				<path d="M183.675,200.091c-16.29,-6.373 -30.142,-13.123 -41.943,-20.248l0,21.561c11.612,5.064 24.715,9.748 39.323,13.873c23.776,7.125 52.05,12.937 85.933,17.625c5.246,0.75 10.862,1.498 16.477,2.062l0,-8.437c-5.615,-0.94 -11.231,-2.063 -16.477,-3.186c-33.324,-6.939 -60.662,-14.625 -83.313,-23.25Z"/>
				<path d="M207.08,177.594c-23.031,-10.875 -40.069,-22.686 -52.803,-35.059l-12.545,0l0,13.684c14.979,12.939 34.45,24.749 61.041,35.062c17.973,6.746 38.942,13.121 64.215,18.748c5.246,1.312 10.862,2.435 16.477,3.56l0,-9.562c-5.8,-1.498 -11.231,-2.998 -16.477,-4.496c-23.588,-6.94 -43.245,-14.247 -59.908,-21.937Z"/>
				<path d="M266.988,142.535l-16.662,0c3.372,2.25 7.115,4.502 10.86,6.752c1.873,1.121 3.749,2.059 5.802,3.184c5.058,2.811 10.491,5.437 16.477,8.25l0,-18.186l-16.477,0Z"/>
				<path d="M238.345,156.219c-7.861,-4.496 -14.602,-8.998 -20.595,-13.684l-32.391,0c10.862,9.559 24.712,18.557 42.69,26.995c11.232,5.25 24.151,10.313 38.939,15.188c5.246,1.688 10.677,3.373 16.477,5.063l0,-12.376c-5.8,-2.248 -11.419,-4.497 -16.477,-6.748c-10.668,-4.686 -20.215,-9.375 -28.643,-14.438Z"/>
			</g>
			<g class="logo-text">
				<path d="M322.475,275.84l23.227,0l0,8.438l-33.891,0l0,-34.899l10.664,0l0,26.461Z"/>
				<rect x="350.319" y="249.379" width="10.664" height="34.899"/>
				<path d="M401.554,261.965l0,-0.094c0,-1.608 -0.485,-2.711 -1.453
disconnecting from server.

```

So it's not working yet, but getting closer.

---

<div class="post-metadata">

**Author:** ![darthvader072](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/darthvader072/32/527671_2.png) [@darthvader072](https://forum.arduino.cc/u/darthvader072)\
**Post date:** [May 26, 2023, 11:23am UTC](https://forum.arduino.cc/t/basic-get-request-wifinina/1130446/23 "2023-05-26T11:23:01Z")

</div>

it loads the server HTML source, so it doesn't add the path...  
As in all examples host is after the request, so it should work.

However; whenever setting the host after the request I end up with statuscode 400 again, as well as Madrix log displaying an error host is missing in http header

---

<div class="post-metadata">

**Author:** ![Juraj](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/juraj/32/238785_2.png) [@Juraj](https://forum.arduino.cc/u/Juraj)\
**Post date:** [May 26, 2023, 12:39pm UTC](https://forum.arduino.cc/t/basic-get-request-wifinina/1130446/24 "2023-05-26T12:39:04Z")

</div>

it doesn't like the IP as "Host"? try your servers name

---

<div class="post-metadata">

**Author:** ![darthvader072](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/darthvader072/32/527671_2.png) [@darthvader072](https://forum.arduino.cc/u/darthvader072)\
**Post date:** [May 26, 2023, 12:45pm UTC](https://forum.arduino.cc/t/basic-get-request-wifinina/1130446/25 "2023-05-26T12:45:14Z")

</div>

Yes, I've tried several.

`"Host: Dynamic"` -- which is the actual hostname on the server

 ![Scherm­afbeelding 2023-05-26 om 09.59.15](https://europe1.discourse-cdn.com/arduino/original/4X/9/b/e/9be52e8dc88a12bc750c9f9b7ff852d040c4ac07.jpeg)  
 ![Scherm­afbeelding 2023-05-26 om 14.47.02](https://europe1.discourse-cdn.com/arduino/original/4X/0/b/0/0b01b5e8537aa91d177c2969199d1b001d5431c0.png)

`"Host: MADRIX` -- which is the actual servername on the server

 ![Scherm­afbeelding 2023-05-26 om 14.48.46](https://europe1.discourse-cdn.com/arduino/original/4X/1/a/1/1a19b0ce4f3a00506ad4b7fb68ae7c9628aae077.png)

`"Host: MADRIX 5"` -- which is the actual hostlabel on the server

 ![Scherm­afbeelding 2023-05-26 om 14.47.29](https://europe1.discourse-cdn.com/arduino/original/4X/4/8/2/48207f75402f89e4283b2a126df66027409aca18.png)

`"Host: 192.168.2.198"` -- what would make sense  
`"Host: "Nano33IoT" `-- just as test

I've also tried to set the hostname of the Nano - board. Unfortunately also without luck.  
I was expecting this might work since when I scan the Nano device through a network scanner no hostname is defined.

`WiFi.setHostname("Nano-33-IoT");`  
Unfortunately, when I scanned after adding this code, the hostname of the board was not updated.

---

<div class="post-metadata">

**Author:** ![darthvader072](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/darthvader072/32/527671_2.png) [@darthvader072](https://forum.arduino.cc/u/darthvader072)\
**Post date:** [May 29, 2023, 10:21am UTC](https://forum.arduino.cc/t/basic-get-request-wifinina/1130446/26 "2023-05-29T10:21:40Z")

</div>

After many testing I decided to change the board.  
Now it works! I'm using a simple NodeMCU - 8266 board which made it possible to use different libraries.

Still hoping if someone knows what's missing on the ArduinoHttpClient library to do this properly

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [November 25, 2023, 10:22am UTC](https://forum.arduino.cc/t/basic-get-request-wifinina/1130446/27 "2023-11-25T10:22:34Z")

</div>

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.

[Previous page](https://forum.arduino.cc/t/basic-get-request-wifinina/1130446.md?page=1)
