ResponseContentFormat Property
The response content format.
Syntax
ANSI (Cross Platform) int GetResponseContentFormat();
int SetResponseContentFormat(int iResponseContentFormat); Unicode (Windows) INT GetResponseContentFormat();
INT SetResponseContentFormat(INT iResponseContentFormat);
@property (nonatomic,readwrite,assign,getter=responseContentFormat,setter=setResponseContentFormat:) int responseContentFormat; - (int)responseContentFormat; - (void)setResponseContentFormat:(int)newResponseContentFormat;
#define PID_COAP_RESPONSECONTENTFORMAT 22 IPWORKSIOT_EXTERNAL void* IPWORKSIOT_CALL IPWorksIoT_CoAP_Get(void *lpObj, int propid, int arridx, int *lpcbVal, int64 *lpllVal); IPWORKSIOT_EXTERNAL int IPWORKSIOT_CALL IPWorksIoT_CoAP_Set(void *lpObj, int propid, int arridx, const void *val, int cbVal);
Default Value
-1
Remarks
When the class is operating in client mode (i.e., the Listening property is disabled), this property is populated with the content format included in incoming responses anytime the RequestComplete event fires.
When the class is operating in server mode (i.e., the Listening property is enabled), this property specifies the content format that should be included in outgoing responses (regardless of whether they are sent immediately after Request fires, or later using SendResponse or SendNotification).
In either case, the valid set of values for this property is -1, or a value in the range 0 to 65535. -1 prevents a Content-Format option from being included when sending a response, or indicates that one was not included in a received response.
The following table provides a (non-exhaustive) list of some of the more common content formats; refer to the IANA's CoAP Content-Formats registry for a full list.
-1 (default) | Content-Format option not included. | |
Value | Media Type | Encoding |
0 | text/plain; charset=utf-8 | |
40 | application/link-format | |
41 | application/xml | |
42 | application/octet-stream | |
47 | application/exi | |
50 | application/json | |
51 | application/json-patch+json | |
52 | application/merge-patch+json | |
60 | application/cbor | |
61 | application/cwt | |
62 | application/multipart-core | |
63 | application/cbor-seq | |
11050 | application/json | deflate |
11060 | application/cbor | deflate |
This property is not available at design time.
Data Type
Integer