ESP8266 URL Encode Decode Example

In this tutorial we are looking at URL encoding and decoding in ESP8266 or NodeMCU. URL encoding converts characters into a format that can be transmitted over the Internet so that web browser can handle it. URL encoding is required when you send HTTP GET requests.NodeMCU URL Encode Decode

What is URL ?

URL – Uniform Resource Locator

Web browsers request pages from web servers by using a URL.

The URL is the address of a web page, like: https://circuits4you.com

URL Encoding (Percent Encoding)

URLs can only be sent over the Internet using the ASCII character-set.

Since URLs often contain characters outside the ASCII set, the URL has to be converted into a valid ASCII format.

URL encoding replaces unsafe ASCII characters with a “%” followed by two hexadecimal digits.

URLs cannot contain spaces. URL encoding normally replaces a space with a plus (+) sign or with %20.

URL Encoding Function

URL Decoding Function

h2int function

ESP8266 URL Encode and Decode

Enter your SSID and Password in code. and then upload.

 

Testing

Open serial monitor and get the ip address.

Open ip address in web browser.

URL Encode

Enter some url text in text box and press URL Encode button. also observe serial monitor.

URL Decode

Enter some url text in text box and press URL Encode button. also observe serial monitor.

URL Encode Decode are useful for HTTP GET method.

Read More

 

Leave a Reply