Set the Body for this request. Charset is assumed to be UTF_8. Data must be encoded.

@param bodyText to send.
@return a RequestTemplate for chaining.
@deprecated use {@link RequestTemplate#body(feign.Request.Body)} instead
542478
@Deprecated
  public RequestTemplate body(String bodyText) {
    byte[] bodyData = bodyText != null ? bodyText.getBytes(UTF_8) : null;
    return body(bodyData, UTF_8);
  }
1365317
public <T> T parseBody(Class<T> clazz) throws ParsableException, MediaTypeException {
        String contentType = request.getContentType();
        
        // if the content type header was not provided, we throw
        if (contentType == null || contentType.isEmpty()) {
            throw new MediaTypeException("Missing media type header");
        }
        
        // extract the actual content type in case charset is also a part of the string
        contentType = HttpHeaderUtil.getContentTypeFromContentTypeAndCharacterSetting(contentType);
        
        ParserEngine engine = parserEngineManager.getParserEngineForContentType(contentType);
        
        if (engine == null) {
            throw new MediaTypeException("An engine for media type ("+contentType+") was not found");
        }
        
        try {
            return engine.invoke(request.getInputStream(), clazz);
        } catch (IOException e) {
            throw new ParsableException(e);
        }
    }
389512
private void setContentType(String contentType) {
        // The content type may contain the charset, parse it and set it.
        if (contentType != null && contentType.contains("charset=")) {
            charset = Charset.forName(contentType.substring(contentType.indexOf("charset=") + 8).trim());
        }
        headers.put(HeaderNames.CONTENT_TYPE, contentType);
    }
865120
protected Request.Builder setBody(Request.Builder builder) {
        if (body != null) {
            RequestBody requestBody = null;
            if (requestBody == null) {
                FormBody.Builder fbBuilder = new FormBody.Builder();
                Iterator<String> itr = body.keySet().iterator();
                while (itr.hasNext()) {
                    String key = itr.next();
                    fbBuilder.add(key, (String) body.get(key));
                }
                requestBody = fbBuilder.build();
            }

            if ("PUT".equalsIgnoreCase(method))
                builder.put(requestBody);
            else if ("POST".equalsIgnoreCase(method))
                builder.post(requestBody);
        }
        return builder;
    }
205420
public void setBody(final WComponent body) {
		DecoratedLabelModel model = getOrCreateComponentModel();

		if (body == null) {
			throw new IllegalArgumentException("Body content must not be null");
		}

		if (model.body != null) {
			remove(model.body);
		}

		model.body = body;
		add(body);
	}
1322776
public HttpRequest body(String body, String contentType) {
		body(StrUtil.bytes(body, this.charset));
		this.form = null; // 当使用body时，停止form的使用
		contentLength((null != body ? body.length() : 0));

		if (null != contentType) {
			// Content-Type自定义设置
			this.contentType(contentType);
		} else {
			// 在用户未自定义的情况下自动根据内容判断
			contentType = HttpUtil.getContentTypeByRequestBody(body);
			if (null != contentType && ContentType.isDefault(this.header(Header.CONTENT_TYPE))) {
				if (null != this.charset) {
					// 附加编码信息
					contentType = ContentType.build(contentType, this.charset);
				}
				this.contentType(contentType);
			}
		}

		// 判断是否为rest请求
		if (StrUtil.containsAnyIgnoreCase(contentType, "json", "xml")) {
			this.isRest = true;
		}
		return this;
	}
577189
@Override
    public StandaloneAhcWSRequest setBody(BodyWritable bodyWritable) {
        this.bodyWritable = bodyWritable;

        String contentType = bodyWritable.contentType();
        if (!headers.containsKey(HttpHeaders.Names.CONTENT_TYPE) && contentType != null) {
            this.addHeader(HttpHeaders.Names.CONTENT_TYPE, bodyWritable.contentType());
        }

        return this;
    }
748919
@Override
	public void setBodyMap(Map<java.util.Locale, String> bodyMap) {
		_commerceNotificationTemplate.setBodyMap(bodyMap);
	}
324091
protected <T> T parseBody(Class<T> clazz) throws ParsableException, MediaTypeException {
        String contentType = context.requestContentType();
        
        // if the content type header was not provided, we throw
        if (contentType == null || contentType.isEmpty()) {
            throw new MediaTypeException("Missing media type header");
        }
        
        // extract the actual content type in case charset is also a part of the string
        contentType = HttpHeaderUtil.getContentTypeFromContentTypeAndCharacterSetting(contentType);
        
        ParserEngine engine = injector.getInstance(ParserEngineManager.class).getParserEngineForContentType(contentType);
        
        if (engine == null) {
            throw new MediaTypeException("An engine for media type ("+contentType+") was not found");
        }
        
        try {
            return engine.invoke(context.requestInputStream(), clazz);
        } catch (IOException e) {
            throw new ParsableException(e);
        }
    }
30181
public function setBody($content, $type = 'text/html', $charset = 'utf-8')
    {
        $this->message->setBody($content, $type, $charset);

        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());

	}
1178498
public function setBody($body, $contentType = null, $charset = null)
    {
        if (isset($charset)) {
            $this->setCharset($charset);
        }
        $body = $this->convertString($body);

        parent::setBody($body, $contentType);

        return $this;
    }
538850
public PactDslRequestWithPath bodyWithSingleQuotes(String body) {
        if (body != null) {
            body = QuoteUtil.convert(body);
        }
        return body(body);
    }
1009438
public PactDslRequestWithPath body(Supplier<String> body, String mimeType) {
        requestBody = OptionalBody.body(body.get().getBytes());
        requestHeaders.put(CONTENT_TYPE, Collections.singletonList(mimeType));
        return this;
    }
273596
public Charset setCharset(Charset charset) {
        Charset prev = this.charset.get();
        this.charset.set(charset);
        return prev;
    }
1029682
public void setText(String text) {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
      if ((text == null) || text.length() < 257) {
        SibTr.entry(this, tc, "setText", text);
      }
      else {
        SibTr.entry(this, tc, "setText", new Object[]{text.length(), text.substring(0,200)+"..."});
      }
    }

    // If the payload is changing, we need to clear all the cached values.
    softRefToDocument = null;
    clearCachedLengths();

    // Set the payload data
    getPayload().setField(JmsTextBodyAccess.BODY_DATA_VALUE, text);

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "setText");
  }
173112
private void encodeTextBody(StringBuffer result, JsJmsTextMessage msg) {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "encodeTextBody");
    try {
      String body = msg.getText();
      if (body != null) {
        result.append('~');
        URLEncode(result, body);
      }
    }
    catch (UnsupportedEncodingException e) {
      FFDCFilter.processException(e, "com.ibm.ws.sib.mfp.impl.WebJsJmsMessageEncoderImpl.encodeTextBody", "193");
      // Just treat it as null.
    }
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "encodeTextBody");
  }