Static builder to create a response with a 200 status code and the string response body.

@param body a string
428922
public static HttpResponse response(String body) {
        return new HttpResponse().withStatusCode(OK_200.code()).withReasonPhrase(OK_200.reasonPhrase()).withBody(body);
    }
1263135
public void writeBodyFromString(String bodyAsString, Charset charset) {
        message.contentEncoding(charset.name())
                .contentType(Message.TEXT_PLAIN);
        byte[] bodyContent = bodyAsString.getBytes(charset);
        message.body(bodyContent);
    }
10791
function createResponse(request, response, body){
  return {
    statusCode: response.statusCode,
    statusText: response.statusMessage,
    headers: response.headers,
    originalUrl: request.url,
    effectiveUrl: request.url,
    redirected: false,
    requestMethod: request.method,
    requestHeaders: request.headers,
    body: body,
    retries: 0,
    throttled: false
  };
}
478191
private void responseEntity(String html, HttpServletResponse servletResponse)
            throws IOException {
        PrintWriter printWriter = servletResponse.getWriter();
        try {
            printWriter.write(html);
            printWriter.flush();
        } finally {
            closeQuietly(printWriter);
        }
    }
341007
protected void _createBody(_IControl body,boolean includeStatusMessage){
    	int statusMessageIndex = body.getContainedControls().size();
    	showErrorsIfAny(body,statusMessageIndex, includeStatusMessage);
    	createBody(body);
    }
32476
@NonNull
    public EmailIntentBuilder body(@NonNull String body) {
        checkNotNull(body);
        this.body = fixLineBreaks(body);
        return this;
    }
814433
public void setResponseBody(HttpResponseBody resBody) {
		if (resBody == null) {
			throw new IllegalArgumentException("The parameter resBody must not be null.");
		}
		mResBody = resBody;
	    getResponseBody().setCharset(getResponseHeader().getCharset());

	}
416380
public RequestTemplate body(Request.Body body) {
    this.body = body;

    header(CONTENT_LENGTH);
    if (body.length() > 0) {
      header(CONTENT_LENGTH, String.valueOf(body.length()));
    }

    return this;
  }
355144
public static String post(String url, String body) {
        return request(HttpRequest.post(replaceLocalHost(url)), body).body();
    }
286220
public static StringBuilder computeMessageBuffer(HttpResponse response) {
    StringBuilder builder = new StringBuilder();
    int statusCode = response.getStatusCode();
    if (statusCode != 0) {
      builder.append(statusCode);
    }
    String statusMessage = response.getStatusMessage();
    if (statusMessage != null) {
      if (statusCode != 0) {
        builder.append(' ');
      }
      builder.append(statusMessage);
    }
    return builder;
  }
47296
public void setResponse(String response) {
		this.response = response;
		try {
			this.responseLength = response.getBytes("UTF-8").length;
		} catch (UnsupportedEncodingException e) {
			this.responseLength = response.length();
		}
	}
368762
public Map<String, Object> evaluateRequestTokenResponse(String responseBody) {
        Map<String, Object> response = new HashMap<String, Object>();
        String endpoint = TwitterConstants.TWITTER_ENDPOINT_REQUEST_TOKEN;

        Map<String, String> responseValues = populateResponseValues(responseBody);

        Map<String, Object> result = checkForEmptyResponse(endpoint, responseBody, responseValues);
        if (result != null) {
            return result;
        }

        // Ensure response contains oauth_callback_confirmed value
        result = checkForRequiredParameters(endpoint, responseValues, TwitterConstants.RESPONSE_OAUTH_CALLBACK_CONFIRMED, TwitterConstants.RESPONSE_OAUTH_TOKEN, TwitterConstants.RESPONSE_OAUTH_TOKEN_SECRET);
        if (result != null) {
            return result;
        }

        String callbackConfirmedVal = responseValues.get(TwitterConstants.RESPONSE_OAUTH_CALLBACK_CONFIRMED);
        if (!callbackConfirmedVal.equalsIgnoreCase("true")) {
            return createErrorResponse("TWITTER_RESPONSE_PARAM_WITH_WRONG_VALUE",
                    new Object[] { TwitterConstants.RESPONSE_OAUTH_CALLBACK_CONFIRMED, endpoint, "true", callbackConfirmedVal });
        }

        String requestToken = "";

        for (Entry<String, String> entry : responseValues.entrySet()) {
            String key = entry.getKey();
            String value = entry.getValue();

            if (key.equals(TwitterConstants.RESPONSE_OAUTH_TOKEN)) {
                requestToken = value;
                if (requestToken.isEmpty()) {
                    return createErrorResponse("TWITTER_RESPONSE_PARAMETER_EMPTY", new Object[] { TwitterConstants.RESPONSE_OAUTH_TOKEN, endpoint });
                }
                if (tc.isDebugEnabled()) {
                    Tr.debug(tc, TwitterConstants.RESPONSE_OAUTH_TOKEN + "=" + requestToken);
                }
            } else if (key.equals(TwitterConstants.RESPONSE_OAUTH_TOKEN_SECRET)) {
                tokenSecret = value;
                if (tokenSecret.isEmpty()) {
                    return createErrorResponse("TWITTER_RESPONSE_PARAMETER_EMPTY", new Object[] { TwitterConstants.RESPONSE_OAUTH_TOKEN_SECRET, endpoint });
                }
                if (tc.isDebugEnabled()) {
                    // Request token secrets are short lived, so logging them should not be an issue
                    Tr.debug(tc, TwitterConstants.RESPONSE_OAUTH_TOKEN_SECRET + "=" + tokenSecret);
                }
            } else if (!key.equals(TwitterConstants.RESPONSE_OAUTH_CALLBACK_CONFIRMED)) {
                if (tc.isDebugEnabled()) {
                    Tr.debug(tc, "Found an unexpected parameter in the response: " + key + "=" + value);
                }
            }
        }

        response.put(TwitterConstants.RESULT_RESPONSE_STATUS, TwitterConstants.RESULT_SUCCESS);
        response.put(TwitterConstants.RESPONSE_OAUTH_TOKEN, requestToken);
        response.put(TwitterConstants.RESPONSE_OAUTH_TOKEN_SECRET, tokenSecret);

        return response;
    }
289152
function (url, method, cb) {

            request({
                url: url,
                method: method
            }, function (error, response, body) {

                if (error) {
                    return cb(error);
                }

                if (response.statusCode == 200 || response.statusCode == 201) {

                    return cb(null, body);

                } else {

                    return cb(new Error('Server responded with error: ' + response.statusCode));

                }

            })

        }
667690
private void createResponse() {
        response = new GenericQueryResponse(
            queryErrorObservable.onBackpressureBuffer(),
            queryRowObservable.onBackpressureBuffer(),
            querySignatureObservable.onBackpressureBuffer(),
            queryStatusObservable.onBackpressureBuffer(),
            queryInfoObservable.onBackpressureBuffer(),
            queryProfileInfoObservable.onBackpressureBuffer(),
            currentRequest,
            status,
            requestID,
            clientContextID
        );
    }
967673
public static Response post(String url, String body) throws HttpException {

		return post(url, body, null, null, DEFAULT_CONNECT_TIMEOUT, DEFAULT_READ_TIMEOUT);
	}
556732
function JWR(responseCtx) {
            this.body = responseCtx.body || {};
            this.headers = responseCtx.headers || {};
            this.statusCode = responseCtx.statusCode || 200;
        }
950205
@SafeVarargs
    public final RequestBuilder body(Map.Entry<String, ?>... formBody) {
        return body(Lists.of(formBody));
    }