Package ch.ethz.inf.vs.californium

Examples of ch.ethz.inf.vs.californium.CoapClient.post()


    System.out.println(response.advanced().getType() + "-" + response.getCode());
    System.out.println(response.getResponseText());
   
    System.out.println("===============\nCC04");
    System.out.println("---------------\nPOST /test\n---------------");
    response = client.post("non-empty", MediaTypeRegistry.TEXT_PLAIN);
    System.out.println(response.advanced().getType() + "-" + response.getCode());
    System.out.println(response.getResponseText());
   
    client.useNONs();
   
View Full Code Here


    System.out.println(response.advanced().getType() + "-" + response.getCode());
    System.out.println(response.getResponseText());
   
    System.out.println("===============\nCC08");
    System.out.println("---------------\nNON-POST /test\n---------------");
    response = client.post("non-empty", MediaTypeRegistry.TEXT_PLAIN);
    System.out.println(response.advanced().getType() + "-" + response.getCode());
    System.out.println(response.getResponseText());

    client.setURI(uri + "/separate");
    client.useCONs();
View Full Code Here

    client.setTimeout(0);
    client.useCONs();
   
    System.out.println("===============\nCC18");
    System.out.println("---------------\nPOST /test for Location-Path\n---------------");
    response = client.post("TD_COAP_CORE_18", MediaTypeRegistry.TEXT_PLAIN);
    System.out.println(response.getCode() + "-" + response.getOptions().getLocationString());
    System.out.println(response.getResponseText());

    client.setURI(uri + "/location-query");
   
View Full Code Here

    client.setURI(uri + "/location-query");
   
    System.out.println("===============\nCC19");
    System.out.println("---------------\nGET /location-query\n---------------");
    response = client.post("query", MediaTypeRegistry.TEXT_PLAIN);
    System.out.println(response.getCode() + "-" + response.getOptions().getLocationString());
    System.out.println(response.getResponseText());
   
    client.setURI(uri + "/multi-format");
   
View Full Code Here

    client.setURI(uri + "/large-create");

    System.out.println("===============\nCB04");
    System.out.println("---------------\nPOST /large-create\n---------------");
    response = client.post(getLargeRequestPayload(), MediaTypeRegistry.TEXT_PLAIN);
    System.out.println(response.getCode() + " - " + response.getOptions().getLocationString());
    System.out.println(response.getResponseText());

    client.setURI(uri + response.getOptions().getLocationString());
View Full Code Here

    client.setURI(uri + "/large-post");

    System.out.println("===============\nCB05");
    System.out.println("---------------\nPOST /large-post\n---------------");
    response = client.post(getLargeRequestPayload(), MediaTypeRegistry.TEXT_PLAIN);
    System.out.println(response.getCode());
    System.out.println(response.getResponseText());

    client.setURI(uri + "/large");
    client.useEarlyNegotiation(16);
View Full Code Here

        });
    long timeout = relation4.getCurrent().getOptions().getMaxAge();
    try { Thread.sleep(6*1000); } catch (InterruptedException e) { }
    System.out.println("---------------\nReboot Server");
    CoapClient clientStimulus = new CoapClient(uri + "/obs-reset");
    clientStimulus.post("sesame", MediaTypeRegistry.TEXT_PLAIN);
    try { Thread.sleep((timeout+6)*1000); } catch (InterruptedException e) { }
    relation4.proactiveCancel();
    try { Thread.sleep(2*1000); } catch (InterruptedException e) { }
   
    client.setURI(uri + "/obs-large");
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.