CoAP-simple-library
CoAP-simple-library copied to clipboard
REQUEST TYPE
there is a way to specify a particular request type (GET, POST, PUT) when we ad a callback method with coap.server ?
Hi @follimatteo , You could check the request type at CoapPacket.code . example is like this.
void callback_light(CoapPacket &packet, IPAddress ip, int port) {
switch (packet.code) {
case COAP_GET:
break;
case COAP_POST:
break;
case COAP_PUT:
break;
case COAP_DELETE :
break;
}