From a1a79a59157f2c191229bf2729e038cfcf1bfe39 Mon Sep 17 00:00:00 2001 From: Andrea Gilardoni Date: Wed, 21 Feb 2024 16:25:42 +0100 Subject: [PATCH] added example for url parsing --- examples/ParseURL/ParseURL.ino | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 examples/ParseURL/ParseURL.ino diff --git a/examples/ParseURL/ParseURL.ino b/examples/ParseURL/ParseURL.ino new file mode 100644 index 0000000..f69a2bc --- /dev/null +++ b/examples/ParseURL/ParseURL.ino @@ -0,0 +1,29 @@ +#include "URLParser.h" + +void setup() { + + Serial.begin(9600); + + while(!Serial); + + Serial.println("starting"); + + ParsedUrl url( + "https://www.google.com/search?q=arduino" + ); + + Serial.print("parsed url schema: \""); + Serial.print(url.schema()); + Serial.print("\"\nparsed url host: \""); + Serial.print(url.host()); + Serial.print("\"\nparsed url path: \""); + Serial.print(url.path()); + Serial.print("\"\nparsed url query: \""); + Serial.print(url.query()); + Serial.print("\"\nparsed url userinfo: \""); + Serial.print(url.userinfo()); + Serial.println("\""); + +} + +void loop() { } \ No newline at end of file