org.summerboot.jexpress.integration.httpclient.RPCDelegate Maven / Gradle / Ivy
package org.summerboot.jexpress.integration.httpclient;
import io.netty.handler.codec.http.HttpResponseStatus;
import org.summerboot.jexpress.nio.server.domain.ServiceContext;
import org.summerboot.jexpress.nio.server.domain.ServiceErrorConvertible;
import java.io.IOException;
import java.net.URLEncoder;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.charset.StandardCharsets;
import java.util.Map;
import java.util.Optional;
public interface RPCDelegate {
/**
* Convert form data in key-pairs (Map) to form request body (string), also
* need to set request header:
* Content-Type=application/x-www-form-urlencoded
*
* @param data
* @return
*/
static String convertFormDataToString(Map