@Override public Boolean hasBodyParam() { return action.hasBodyParam(); }
private void assignBodyFromSerialization(RequestBuilder requestBuilder, RestAction<?> action) throws ActionException { String data; if (action.hasBodyParam()) { SerializedValue serializedValue = getSerializedValue(action, action.getBodyParam()); ContentType contentType = serializedValue.getContentType(); data = serializedValue.getData(); requestBuilder.setHeader(HttpHeaders.CONTENT_TYPE, contentType.toString()); } else { // Fixes an issue for all IE versions (IE 11 is the latest at this time). If request data is not // explicitly set to 'null', the JS 'undefined' will be sent as the request body on IE. Other // browsers don't send undefined bodies. data = null; } requestBuilder.setRequestData(data); }