Search in sources :

Example 11 with HttpHeader

use of com.bluenimble.platform.http.HttpHeader in project serverless by bluenimble.

the class DefaultHttpClient method updateCookies.

protected void updateCookies(HttpResponse response) {
    if (!updateCookies) {
        return;
    }
    HttpHeader cookie = response.getHeader(HttpHeaders.SET_COOKIE);
    if (cookie == null) {
        return;
    }
    cookies = cookie.getValues();
}
Also used : HttpHeader(com.bluenimble.platform.http.HttpHeader)

Example 12 with HttpHeader

use of com.bluenimble.platform.http.HttpHeader in project serverless by bluenimble.

the class BodyAwareRequest method setContentType.

private String setContentType() {
    String boundary = getBoundary();
    String ct = contentType;
    if (boundary != null) {
        ct = contentType + "; boundary=" + boundary;
    }
    List<HttpHeader> headers = getHeaders();
    if (headers == null) {
        headers = new ArrayList<HttpHeader>();
        setHeaders(headers);
    }
    headers.add(new HttpHeaderImpl(HttpHeaders.CONTENT_TYPE, ct));
    return boundary;
}
Also used : HttpHeader(com.bluenimble.platform.http.HttpHeader) HttpHeaderImpl(com.bluenimble.platform.http.impls.HttpHeaderImpl)

Aggregations

HttpHeader (com.bluenimble.platform.http.HttpHeader)12 HttpHeaderImpl (com.bluenimble.platform.http.impls.HttpHeaderImpl)6 HttpEndpoint (com.bluenimble.platform.http.HttpEndpoint)4 HttpParameter (com.bluenimble.platform.http.HttpParameter)3 HttpParameterImpl (com.bluenimble.platform.http.impls.HttpParameterImpl)3 JsonObject (com.bluenimble.platform.json.JsonObject)3 InputStream (java.io.InputStream)3 URI (java.net.URI)3 ArrayList (java.util.ArrayList)3 CommandExecutionException (com.bluenimble.platform.cli.command.CommandExecutionException)2 StreamPointer (com.bluenimble.platform.cli.command.parser.converters.StreamPointer)2 YamlObject (com.bluenimble.platform.cli.impls.YamlObject)2 HttpClientException (com.bluenimble.platform.http.HttpClientException)2 HttpMessageBody (com.bluenimble.platform.http.HttpMessageBody)2 HttpRequestSignerException (com.bluenimble.platform.http.auth.HttpRequestSignerException)2 AccessSecretKeysBasedHttpRequestSigner (com.bluenimble.platform.http.auth.impls.AccessSecretKeysBasedHttpRequestSigner)2 HttpMessageBodyImpl (com.bluenimble.platform.http.impls.HttpMessageBodyImpl)2 StringHttpMessageBodyPart (com.bluenimble.platform.http.impls.StringHttpMessageBodyPart)2 HttpRequest (com.bluenimble.platform.http.request.HttpRequest)2 FileInputStream (java.io.FileInputStream)2