com.github.dreamhead.moco.util.Cookies Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of moco-core Show documentation
Show all versions of moco-core Show documentation
Moco is an easy setup stub framework, mainly focusing on testing and integration.
package com.github.dreamhead.moco.util;
import io.netty.handler.codec.http.cookie.ServerCookieEncoder;
import io.netty.handler.codec.http.cookie.Cookie;
import io.netty.handler.codec.http.cookie.DefaultCookie;
public final class Cookies {
public String encodeCookie(final String key, final String value) {
Cookie cookie = new DefaultCookie(key, value);
cookie.setPath("/");
return ServerCookieEncoder.STRICT.encode(cookie);
}
}