cn.hutool.core.net.FormUrlencoded Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of hutool-all Show documentation
Show all versions of hutool-all Show documentation
Hutool是一个小而全的Java工具类库,通过静态方法封装,降低相关API的学习成本,提高工作效率,使Java拥有函数式语言般的优雅,让Java语言也可以“甜甜的”。
package cn.hutool.core.net;
import cn.hutool.core.codec.PercentCodec;
/**
* application/x-www-form-urlencoded,遵循W3C HTML Form content types规范,如空格须转+,+须被编码
* 规范见:https://url.spec.whatwg.org/#urlencoded-serializing
*
* @since 5.7.16
*/
public class FormUrlencoded {
/**
* query中的value,默认除"-", "_", ".", "*"外都编码
* 这个类似于JDK提供的{@link java.net.URLEncoder}
*/
public static final PercentCodec ALL = PercentCodec.of(RFC3986.UNRESERVED)
.removeSafe('~').addSafe('*').setEncodeSpaceAsPlus(true);
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy