6.6 Use of the CoAP FETCH method

When both Originator and Receiver are using oneM2M Release 5 or later all Blocking RETRIEVE requests shall be sent using the CoAP FETCH method defined in RFC 8132 [6]. The FETCH method differs from the GET method in that it contains a CoAP payload.

The CoAP payload shall be set to contain the oneM2M Request primitive, serialized as described in clause 6.2.2.

RFC 8132 requires that the CoAP Content-Format option be present in the request to indicate the nature of the payload. The Content-Format shall be set to one of the oneM2M-specific MIME media type values defined in clause 6.2.2.2. The value to use depends on the encoding used for the request as follows:

  • application/vnd.onem2m-preq+xml if the request is encoded using XML
  • application/vnd.onem2m-preq+json if the request is encoded using JSON
  • application/vnd.onem2m-preq+cbor if the request is encoded using CBOR