Search in sources :

Example 6 with HttpHeaders

use of com.okta.commons.http.HttpHeaders in project okta-sdk-java by okta.

the class DefaultDataStore method headers.

private HttpHeaders headers(Map<String, List<String>> headerParameters) {
    if (!Collections.isEmpty(headerParameters)) {
        HttpHeaders headers = new HttpHeaders();
        headers.putAll(headerParameters);
        return headers;
    }
    return null;
}
Also used : HttpHeaders(com.okta.commons.http.HttpHeaders)

Example 7 with HttpHeaders

use of com.okta.commons.http.HttpHeaders in project okta-idx-java by okta.

the class BaseIDXClient method getHttpHeaders.

private HttpHeaders getHttpHeaders(boolean isOAuth2Endpoint) {
    HttpHeaders httpHeaders = new HttpHeaders();
    if (isOAuth2Endpoint) {
        httpHeaders.add("Content-Type", "application/x-www-form-urlencoded");
        httpHeaders.add("Accept", "application/json");
    } else {
        httpHeaders.add("Content-Type", "application/ion+json; okta-version=1.0.0");
        httpHeaders.add("Accept", "application/ion+json; okta-version=1.0.0");
    }
    httpHeaders.add(HttpHeaders.USER_AGENT, USER_AGENT_HEADER_VALUE);
    return httpHeaders;
}
Also used : HttpHeaders(com.okta.commons.http.HttpHeaders)

Aggregations

HttpHeaders (com.okta.commons.http.HttpHeaders)7 Response (com.okta.commons.http.Response)4 ByteArrayInputStream (java.io.ByteArrayInputStream)4 InputStream (java.io.InputStream)3 DefaultRequest (com.okta.commons.http.DefaultRequest)2 DefaultResponse (com.okta.commons.http.DefaultResponse)2 MediaType (com.okta.commons.http.MediaType)2 Request (com.okta.commons.http.Request)2 JsonNode (com.fasterxml.jackson.databind.JsonNode)1 HttpException (com.okta.commons.http.HttpException)1 HttpMethod (com.okta.commons.http.HttpMethod)1 QueryString (com.okta.commons.http.QueryString)1 ProcessingException (com.okta.idx.sdk.api.exception.ProcessingException)1 IDXClientContext (com.okta.idx.sdk.api.model.IDXClientContext)1 AnswerChallengeRequest (com.okta.idx.sdk.api.request.AnswerChallengeRequest)1 CancelRequest (com.okta.idx.sdk.api.request.CancelRequest)1 ChallengeRequest (com.okta.idx.sdk.api.request.ChallengeRequest)1 EnrollRequest (com.okta.idx.sdk.api.request.EnrollRequest)1 EnrollUserProfileUpdateRequest (com.okta.idx.sdk.api.request.EnrollUserProfileUpdateRequest)1 IdentifyRequest (com.okta.idx.sdk.api.request.IdentifyRequest)1