Code example for BasicHeader

0
                new ProtocolVersion("HTTP",1,1), 400, "Bad Request"));
        InputStreamEntity inputStreamEntity = new InputStreamEntity(
                new ByteArrayInputStream(errorJson.getBytes()),
                errorJson.getBytes().length);
        httpResponse.setEntity(inputStreamEntity);
        httpResponse.setHeader(new BasicHeader(CONTENT_TYPE_KEY,
                                               UA_JSON_RESPONSE));
 
        ScheduleAPIResponseHandler handler = new ScheduleAPIResponseHandler();
 
        try{ 
            handler.handleResponse(httpResponse);
        } 
        catch (APIRequestException ex){
            APIErrorDetails details = ex.getError().get().getDetails().get();
            assertTrue("Incorrect error details", details.getError().equals("Unexpected token '#'"));
            assertTrue("HttpResponse set incorrectly", ex.getHttpResponse().equals(httpResponse));
            return; 
        } 
        catch (Exception ex){