/** * Sends an advanced synchronous request that has to be configured by the developer. * * @param request the custom request * @return the CoAP response */ public CoapResponse advanced(Request request) { assignClientUriIfEmpty(request); return synchronous(request); }
private CoapResponse synchronous(Request request) { return synchronous(request, getEffectiveEndpoint(request)); }
/** * Sends a GET request and blocks until the response is available. * * @return the CoAP response */ public CoapResponse get() { return synchronous(newGet().setURI(uri)); }
/** * Sends a DELETE request and waits for the response. * * @return the CoAP response */ public CoapResponse delete() { return synchronous(newDelete().setURI(uri)); }
/** * Sends a DELETE request and waits for the response. * * @return the CoAP response */ public CoapResponse delete() { return synchronous(Request.newDelete().setURI(uri)); }
/** * Sends a GET request with the specified Accept option and blocks * until the response is available. * * @param accept the Accept option * @return the CoAP response */ public CoapResponse get(int accept) { return synchronous(accept(Request.newGet().setURI(uri), accept)); }
/** * Sends a GET request with the specified Accept option and blocks * until the response is available. * * @param accept the Accept option * @return the CoAP response */ public CoapResponse get(int accept) { return synchronous(accept(newGet().setURI(uri), accept)); }
public CoapResponse validate(byte[] ... etags) { return synchronous(etags(newGet().setURI(uri), etags)); }
/** * Sends a PUT request with payload and required Content-Format and blocks * until the response is available. * * @param payload the payload * @param format the Content-Format * @return the CoAP response */ public CoapResponse put(byte[] payload, int format) { return synchronous(format(newPut().setURI(uri).setPayload(payload), format)); }
/** * Sends a PUT request with payload and required Content-Format and blocks * until the response is available. * * @param payload the payload * @param format the Content-Format * @return the CoAP response */ public CoapResponse put(String payload, int format) { return synchronous(format(newPut().setURI(uri).setPayload(payload), format)); }
/** * Sends a POST request with the specified payload and the specified content * format option and blocks until the response is available. * * @param payload * the payload * @param format * the Content-Format * @return the CoAP response */ public CoapResponse post(String payload, int format) { return synchronous(format(newPost().setURI(uri).setPayload(payload), format)); }
/** * Sends a PUT request with payload and required Content-Format and blocks * until the response is available. * * @param payload the payload * @param format the Content-Format * @return the CoAP response */ public CoapResponse put(String payload, int format) { return synchronous(format(Request.newPut().setURI(uri).setPayload(payload), format)); }
/** * Sends a PUT request with payload and required Content-Format and blocks * until the response is available. * * @param payload the payload * @param format the Content-Format * @return the CoAP response */ public CoapResponse put(byte[] payload, int format) { return synchronous(format(Request.newPut().setURI(uri).setPayload(payload), format)); }
/** * Sends a PUT request with the If-None-Match option set and blocks until * the response is available. * * @param payload the payload string * @param format the Content-Format * @return the CoAP response */ public CoapResponse putIfNoneMatch(String payload, int format) { return synchronous(ifNoneMatch(format(Request.newPut().setURI(uri).setPayload(payload), format))); }
/** * Sends a PUT request with with the specified ETags in the If-Match option * and blocks until the response is available. * * @param payload the payload string * @param format the Content-Format * @param etags the ETags for the If-Match option * @return the CoAP response */ public CoapResponse putIfMatch(String payload, int format, byte[] ... etags) { return synchronous(ifMatch(format(newPut().setURI(uri).setPayload(payload), format), etags)); }
/** * Sends a PUT request with the If-None-Match option set and blocks until * the response is available. * * @param payload the payload * @param format the Content-Format * @return the CoAP response */ public CoapResponse putIfNoneMatch(byte[] payload, int format) { return synchronous(ifNoneMatch(format(newPut().setURI(uri).setPayload(payload), format))); }
/** * Sends a PUT request with the If-None-Match option set and blocks until * the response is available. * * @param payload the payload string * @param format the Content-Format * @return the CoAP response */ public CoapResponse putIfNoneMatch(String payload, int format) { return synchronous(ifNoneMatch(format(newPut().setURI(uri).setPayload(payload), format))); }
/** * Sends a PUT request with with the specified ETags in the If-Match option * and blocks until the response is available. * * @param payload the payload * @param format the Content-Format * @param etags the ETags for the If-Match option * @return the CoAP response */ public CoapResponse putIfMatch(byte[] payload, int format, byte[] ... etags) { return synchronous(ifMatch(format(newPut().setURI(uri).setPayload(payload), format), etags)); }
/** * Sends a PUT request with with the specified ETags in the If-Match option * and blocks until the response is available. * * @param payload the payload * @param format the Content-Format * @param etags the ETags for the If-Match option * @return the CoAP response */ public CoapResponse putIfMatch(byte[] payload, int format, byte[] ... etags) { return synchronous(ifMatch(format(Request.newPut().setURI(uri).setPayload(payload), format), etags)); }
/** * Sends a PUT request with the If-None-Match option set and blocks until * the response is available. * * @param payload the payload * @param format the Content-Format * @return the CoAP response */ public CoapResponse putIfNoneMatch(byte[] payload, int format) { return synchronous(ifNoneMatch(format(Request.newPut().setURI(uri).setPayload(payload), format))); }