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 WebResource.Builder 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 (WebResource.Builder object).
Notes
- The non-null value specified in the type parameter is set in the Content-Type HTTP header. A null 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.
- You can also use the following methods to change the value of the Content-Type HTTP header:
- ClientRequest.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
- WebResource class
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.