@Override protected byte[] getByteStreamRequestContents() { return StringUtils.defaultString(myResourceString, "") .getBytes(ResourceParameter.determineRequestCharset(this)); }
public static Reader createRequestReader(RequestDetails theRequest) { return createRequestReader(theRequest, determineRequestCharset(theRequest)); }
@Override public boolean incomingRequestPostProcessed(RequestDetails theRequestDetails, HttpServletRequest theRequest, HttpServletResponse theResponse) throws AuthenticationException { EncodingEnum encoding = RestfulServerUtils.determineRequestEncodingNoDefault(theRequestDetails); if (encoding == null) { ourLog.trace("Incoming request does not appear to be FHIR, not going to validate"); return true; } Charset charset = ResourceParameter.determineRequestCharset(theRequestDetails); String requestText = new String(theRequestDetails.loadRequestContents(), charset); if (isBlank(requestText)) { ourLog.trace("Incoming request does not have a body"); return true; } ValidationResult validationResult = validate(requestText, theRequestDetails); // The JPA server will use this theRequestDetails.getUserData().put(REQUEST_VALIDATION_RESULT, validationResult); return true; }
FhirContext ctx = theRequest.getServer().getFhirContext(); final Charset charset = determineRequestCharset(theRequest); Reader requestReader = createRequestReader(theRequest, charset);
public static Reader createRequestReader(RequestDetails theRequest) { return createRequestReader(theRequest, determineRequestCharset(theRequest)); }
@Override public boolean incomingRequestPostProcessed(RequestDetails theRequestDetails, HttpServletRequest theRequest, HttpServletResponse theResponse) throws AuthenticationException { EncodingEnum encoding = RestfulServerUtils.determineRequestEncodingNoDefault(theRequestDetails); if (encoding == null) { ourLog.trace("Incoming request does not appear to be FHIR, not going to validate"); return true; } Charset charset = ResourceParameter.determineRequestCharset(theRequestDetails); String requestText = new String(theRequestDetails.loadRequestContents(), charset); if (isBlank(requestText)) { ourLog.trace("Incoming request does not have a body"); return true; } ValidationResult validationResult = validate(requestText, theRequestDetails); // The JPA server will use this theRequestDetails.getUserData().put(REQUEST_VALIDATION_RESULT, validationResult); return true; }
FhirContext ctx = theRequest.getServer().getFhirContext(); final Charset charset = determineRequestCharset(theRequest); Reader requestReader = createRequestReader(theRequest, charset);