uCosminexus Application Server, Web Service Development Guide
![[Contents]](FIGURE/CONTENT.GIF)
![[Glossary]](FIGURE/GLOSS.GIF)
![[Index]](FIGURE/INDEX.GIF)
![[Back]](FIGURE/FRONT.GIF)
entity(Object entity, MediaType type) method
Description
Syntax
public T entity(Object entity,
MediaType type)
Parameters
- entity
- This is an HTTP request entity.
- type
- This is a MIME media type.
Return value
The method returns a builder (ClientRequest.Builder object).
Notes
- If null is specified in the type parameter, the value is ignored and is not set in the Content-Type HTTP header.
- The value returned by the toString() method of the MediaType object is set in the Content-Type HTTP header. The JAX-RS engine does not validate the values returned by the toString() method. Specify the value according to the standard specifications.
- If the value of the Content-Type HTTP header is already set by using the following methods, the value is overwritten by the value of the type parameter:
- ClientRequest.Builder class
entity(Object entity, String type) method
header(String name, Object value) method
type(MediaType type) method
type(String type) method
- WebResource class
entity(Object entity, MediaType type) method
entity(Object entity, String type) method
header(String name, Object value) method
type(MediaType type) method
type(String type) method
- WebResource.Builder class
entity(Object entity, MediaType type) method
entity(Object entity, String type) method
header(String name, Object value) method
type(MediaType type) method
type(String type) method
The operation when the MIME media type is not set with these methods and the entity(Object entity, MediaType type) method is the same as the operation when the Content-Type HTTP header is not set in the HttpURLConnection object before performing HTTP communication.
All Rights Reserved. Copyright (C) 2013, Hitachi, Ltd.