Parses the given URL-encoded content into the given data object of data key name/value pairs,
including support for repeating data key names.
Declared fields of a "primitive" type (as defined by Data#isPrimitive(Type) are
parsed using Data#parsePrimitiveValue(Type, String) where the Class parameter
is the declared field class. Declared fields of type Collection are used to support
repeating data key names, so each member of the collection is an additional data key value.
They are parsed the same as "primitive" fields, except that the generic type parameter of the
collection is used as the Class parameter.
If there is no declared field for an input parameter name, it will be ignored unless the
input data parameter is a Map. If it is a map, the parameter value will be
stored either as a string, or as a ArrayList<String> in the case of repeated
parameters.
Parses the given URL-encoded content into the given data object of data key name/value pairs,
including support for repeating data key names.
Declared fields of a "primitive" type (as defined by Data#isPrimitive(Type) are
parsed using Data#parsePrimitiveValue(Type, String) where the Class parameter
is the declared field class. Declared fields of type Collection are used to support
repeating data key names, so each member of the collection is an additional data key value.
They are parsed the same as "primitive" fields, except that the generic type parameter of the
collection is used as the Class parameter.
If there is no declared field for an input parameter name, it is ignored unless the input
data parameter is a Map. If it is a map, the parameter value is stored either
as a string, or as a ArrayList<String> in the case of repeated parameters.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[],[],null,["# Class UrlEncodedParser (2.0.0)\n\nVersion latestkeyboard_arrow_down\n\n- [2.0.0 (latest)](/java/docs/reference/google-http-client/latest/com.google.api.client.http.UrlEncodedParser)\n- [1.47.1](/java/docs/reference/google-http-client/1.47.1/com.google.api.client.http.UrlEncodedParser)\n- [1.46.3](/java/docs/reference/google-http-client/1.46.3/com.google.api.client.http.UrlEncodedParser)\n- [1.45.3](/java/docs/reference/google-http-client/1.45.3/com.google.api.client.http.UrlEncodedParser)\n- [1.44.2](/java/docs/reference/google-http-client/1.44.2/com.google.api.client.http.UrlEncodedParser)\n- [1.43.2](/java/docs/reference/google-http-client/1.43.2/com.google.api.client.http.UrlEncodedParser)\n- [1.42.3](/java/docs/reference/google-http-client/1.42.3/com.google.api.client.http.UrlEncodedParser)\n- [1.41.8](/java/docs/reference/google-http-client/1.41.8/com.google.api.client.http.UrlEncodedParser) \n\n public class UrlEncodedParser implements ObjectParser\n\nImplements support for HTTP form content encoding parsing of type `\napplication/x-www-form-urlencoded` as specified in the [HTML 4.0\nSpecification](http://www.w3.org/TR/1998/REC-html40-19980424/interact/forms.html#h-17.13.4.1).\n\nImplementation is thread-safe.\n\nThe data is parsed using [#parse(String, Object)](/java/docs/reference/google-http-client/latest/com.google.api.client.http.UrlEncodedParser#com_google_api_client_http_UrlEncodedParser_parse_java_lang_String_java_lang_Object_).\n\nSample usage:\n\nstatic void setParser(HttpTransport transport) {\ntransport.addParser(new UrlEncodedParser());\n} \n\nInheritance\n-----------\n\n[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \\\u003e UrlEncodedParser \n\nImplements\n----------\n\n[ObjectParser](/java/docs/reference/google-http-client/latest/com.google.api.client.util.ObjectParser) \n\nInherited Members\n-----------------\n\n[Object.clone()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone--) \n[Object.equals(Object)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-) \n[Object.finalize()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--) \n[Object.getClass()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--) \n[Object.hashCode()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--) \n[Object.notify()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--) \n[Object.notifyAll()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--) \n[Object.toString()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--) \n[Object.wait()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--) \n[Object.wait(long)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-) \n[Object.wait(long,int)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-)\n\nStatic Fields\n-------------\n\n### CONTENT_TYPE\n\n public static final String CONTENT_TYPE\n\n`\"application/x-www-form-urlencoded\"` content type.\n\n### MEDIA_TYPE\n\n public static final String MEDIA_TYPE\n\n`\"application/x-www-form-urlencoded\"` media type with UTF-8 encoding.\n\nStatic Methods\n--------------\n\n### parse(Reader reader, Object data)\n\n public static void parse(Reader reader, Object data)\n\nParses the given URL-encoded content into the given data object of data key name/value pairs,\nincluding support for repeating data key names.\n\nDeclared fields of a \"primitive\" type (as defined by [Data#isPrimitive(Type)](/java/docs/reference/google-http-client/latest/com.google.api.client.util.Data#com_google_api_client_util_Data_isPrimitive_java_lang_reflect_Type_) are\nparsed using [Data#parsePrimitiveValue(Type, String)](/java/docs/reference/google-http-client/latest/com.google.api.client.util.Data#com_google_api_client_util_Data_parsePrimitiveValue_java_lang_reflect_Type_java_lang_String_) where the [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html) parameter\nis the declared field class. Declared fields of type [Collection](https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html) are used to support\nrepeating data key names, so each member of the collection is an additional data key value.\nThey are parsed the same as \"primitive\" fields, except that the generic type parameter of the\ncollection is used as the [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html) parameter.\n\nIf there is no declared field for an input parameter name, it will be ignored unless the\ninput `data` parameter is a [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html). If it is a map, the parameter value will be\nstored either as a string, or as a [ArrayList](https://docs.oracle.com/javase/8/docs/api/java/util/ArrayList.html)\\\u003cString\\\u003e in the case of repeated\nparameters.\n\n### parse(Reader reader, Object data, boolean decodeEnabled)\n\n public static void parse(Reader reader, Object data, boolean decodeEnabled)\n\nParses the given URL-encoded content into the given data object of data key name/value pairs,\nincluding support for repeating data key names.\n\nDeclared fields of a \"primitive\" type (as defined by [Data#isPrimitive(Type)](/java/docs/reference/google-http-client/latest/com.google.api.client.util.Data#com_google_api_client_util_Data_isPrimitive_java_lang_reflect_Type_) are\nparsed using [Data#parsePrimitiveValue(Type, String)](/java/docs/reference/google-http-client/latest/com.google.api.client.util.Data#com_google_api_client_util_Data_parsePrimitiveValue_java_lang_reflect_Type_java_lang_String_) where the [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html) parameter\nis the declared field class. Declared fields of type [Collection](https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html) are used to support\nrepeating data key names, so each member of the collection is an additional data key value.\nThey are parsed the same as \"primitive\" fields, except that the generic type parameter of the\ncollection is used as the [Class](https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html) parameter.\n\nIf there is no declared field for an input parameter name, it is ignored unless the input\n`data` parameter is a [Map](https://docs.oracle.com/javase/8/docs/api/java/util/Map.html). If it is a map, the parameter value is stored either\nas a string, or as a [ArrayList](https://docs.oracle.com/javase/8/docs/api/java/util/ArrayList.html)\\\u003cString\\\u003e in the case of repeated parameters.\n\n### parse(String content, Object data)\n\n public static void parse(String content, Object data)\n\nParses the given URL-encoded content into the given data object of data key name/value pairs\nusing [#parse(Reader, Object)](/java/docs/reference/google-http-client/latest/com.google.api.client.http.UrlEncodedParser#com_google_api_client_http_UrlEncodedParser_parse_java_io_Reader_java_lang_Object_).\n\n### parse(String content, Object data, boolean decodeEnabled)\n\n public static void parse(String content, Object data, boolean decodeEnabled)\n\nParses the given URL-encoded content into the given data object of data key name/value pairs\nusing [#parse(Reader, Object)](/java/docs/reference/google-http-client/latest/com.google.api.client.http.UrlEncodedParser#com_google_api_client_http_UrlEncodedParser_parse_java_io_Reader_java_lang_Object_).\n\nConstructors\n------------\n\n### UrlEncodedParser()\n\n public UrlEncodedParser()\n\nMethods\n-------\n\n### \\\u003cT\\\u003eparseAndClose(InputStream in, Charset charset, Class\\\u003cT\\\u003e dataClass)\n\n public T \u003cT\u003eparseAndClose(InputStream in, Charset charset, Class\u003cT\u003e dataClass)\n\nParses the given input stream into a new instance of the the given data class of key/value\npairs and closes the input stream.\n\n### \\\u003cT\\\u003eparseAndClose(Reader reader, Class\\\u003cT\\\u003e dataClass)\n\n public T \u003cT\u003eparseAndClose(Reader reader, Class\u003cT\u003e dataClass)\n\nParses the given reader into a new instance of the the given data class of key/value pairs and\ncloses the reader.\n\n### parseAndClose(InputStream in, Charset charset, Type dataType)\n\n public Object parseAndClose(InputStream in, Charset charset, Type dataType)\n\nParses the given input stream into a new instance of the the given data type of key/value pairs\nand closes the input stream.\n\n### parseAndClose(Reader reader, Type dataType)\n\n public Object parseAndClose(Reader reader, Type dataType)\n\nParses the given reader into a new instance of the the given data type of key/value pairs and\ncloses the reader."]]