Class BodyParser
java.lang.Object
com.creativityfactory.swiftserver.utils.BodyParser
A utility class that parses the body of an HTTP request.
-
Constructor Summary
-
Method Summary
-
Constructor Details
-
BodyParser
public BodyParser()
-
-
Method Details
-
urlEncoded
Parses the URL-encoded body of an HTTP request and returns a map of key-value pairs.- Parameters:
body
- the URL-encoded body string to be parsedencoding
- the character encoding to be used for decoding the URL-encoded string- Returns:
- a map of key-value pairs parsed from the URL-encoded body string
- Throws:
NullPointerException
- if the body or encoding is nullIllegalArgumentException
- if the encoding is not supported
-