MKR1000 Working Examples of WebClient usage

Hi,

I'm struggling with my MKR1000 to reproduce the Arduino example showing GET POST functionality.

The example at: https://www.arduino.cc/en/Tutorial/Wifi101WiFiWebClientRepeating

appears relatively straightforward, but the response from the www.arduino.cc web site to the query in the example code is the following.

HTTP/1.1 301 Moved Permanently
Content-Type: text/html
Date: Mon, 16 Apr 2018 22:24:48 GMT
Location: https://www.arduino.cc/latest.txt
Server: nginx/1.4.2
Content-Length: 184
Connection: Close

301 Moved Permanently

301 Moved Permanently


nginx/1.4.2

I could use a working example that fixes this issue.

Thank you in advance.

Kevan Evans

I could use a working example that fixes this issue.

What exactly should be fixed here? This is a correct result, you might have expected something else but a 301 response is allowed and makes sense. Don't expect your Arduino to behave like a browser and interpreting the returned response automatically.

With your patience, the example at: https://www.arduino.cc/en/Tutorial/Wifi101WiFiWebClientRepeating was supposed to show a 'working' example of a POST, not a failure. I assume from the code that the 'tutorial' was supposed demonstrate a working scenario reading back a text file on the Arduino website.

Yes, I understand 're-directs' are a fact of life, and the 301 may be the correct web response, but I still need a working set of examples of the MKR1000 and Arduino libraries that can POST, GET, and more. Have yet to see this MKR1000 and libraries function.

Am I supposed to fix the library, fix the Arduino website, or fix the tutorial?

With your patience, the example at: https://www.arduino.cc/en/Tutorial/Wifi101WiFiWebClientRepeating was supposed to show a 'working' example of a POST, not a failure.

A 301 response code is not a failure!

Yes, I understand 're-directs' are a fact of life, and the 301 may be the correct web response, but I still need a working set of examples of the MKR1000 and Arduino libraries that can POST, GET, and more. Have yet to see this MKR1000 and libraries function.

What is not working there? Change to URL to one of your servers and implement a correct server part to have a backend for your POST calls. POST calls usually change something on the server and I understand that the Arduino people doesn't want an example runner to change their server content.

Am I supposed to fix the library, fix the Arduino website, or fix the tutorial?

None of them, fix your expectations.

Thanks for the guidance and thoughts. I'll try somewhere else for some working WebClient examples/tutorials.