uCosminexus Application Server, Web Service Development Guide
![[Contents]](FIGURE/CONTENT.GIF)
![[Glossary]](FIGURE/GLOSS.GIF)
![[Index]](FIGURE/INDEX.GIF)
![[Back]](FIGURE/FRONT.GIF)
accept(String... types) method
Description
This method adds a receivable MIME media type.
Syntax
public T accept(String... types)
Parameter
- types
- This is an array of the receivable MIME media types.
Return value
The method returns a builder (WebResource.Builder object) to set up a WebResource object.
Notes
- The non-null value included in the types parameter is added in the Accept HTTP header. A null value is ignored and is not added in the Accept HTTP header.
- The specified values are set in the Accept HTTP header as are. The JAX-RS engine does not validate the specified value. Specify a value according to the standard specifications.
- You can also use the following methods to add the value of the Accept HTTP header:
- ClientRequest.Builder class
accept(MediaType... types) method
header(String name, Object value) method
- WebResource class
accept(MediaType... types) method
accept(String... types) method
header(String name, Object value) method
- WebResource.Builder class
accept(MediaType... types) method
accept(String... types) method
header(String name, Object value) method
The operation when no receivable MIME media type is added with these methods and the accept(String... types) method is the same as the operation when the Accept HTTP header is not added in the HttpURLConnection object before performing HTTP communication.
All Rights Reserved. Copyright (C) 2013, Hitachi, Ltd.