HTTPURLDecode Function

Microchip TCP/IP Stack

Microchip TCP/IP Stack Help
HTTPURLDecode Function
C
BYTE* HTTPURLDecode(
    BYTE* cData
);
Description

Parses a string from URL encoding to plain-text. The following conversions are made: ‘=’ to ‘0’, ‘&’ to ‘0’, ‘+’ to ‘ ‘, and “%xx” to a single hex byte. 

After completion, the data has been decoded and a null terminator signifies the end of a name or value. A second null terminator (or a null name parameter) indicates the end of all the data.

Preconditions

The data parameter is null terminated and has at least one extra byte free.

Parameters
Parameters 
Description 
cData 
The string which is to be decoded in place. 
Returns

A pointer to the last null terminator in data, which is also the first free byte for new data.

Remarks

This function is called by the stack to parse GET arguments and cookie data. User applications can use this function to decode POST data, but first need to verify that the string is null-terminated.

Microchip TCP/IP Stack 5.42.08 - June 15, 2013
Copyright © 2012 Microchip Technology, Inc.  All rights reserved.