-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add options command, example with coap.me
Signed-off-by: 1998-felix <[email protected]>
- Loading branch information
1 parent
4940a67
commit 1a2256f
Showing
2 changed files
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
host="coap.me" | ||
port="5683" | ||
testPath="/test" | ||
largePath="/large" | ||
etagPath="/etag" | ||
payload="Hello world from absmach/coap-cli" | ||
|
||
#Get | ||
echo "Sending GET request to $host:$port$testPath" | ||
coap-cli get $testPath -H $host -p $port | ||
sleep 1 | ||
|
||
#Get with blockwise transfer | ||
echo "Sending GET request with blockwise transfer to $host:$port$testPath" | ||
coap-cli get $largePath -H $host -p $port | ||
sleep 1 | ||
|
||
#Post | ||
echo "Sending POST request to $host:$port$testPath" | ||
coap-cli post $testPath -H $host -p $port -d $payload | ||
sleep 1 | ||
|
||
#Post with content format | ||
echo "Sending POST request with content format to $host:$port$testPath" | ||
coap-cli post $testPath -H $host -p $port -d $payload -c 50 | ||
sleep 1 | ||
|
||
#Post with authentication | ||
echo "Sending POST request with authentication to $host:$port$testPath" | ||
coap-cli post $testPath -H $host -p $port -d $payload --auth "test" | ||
sleep 1 | ||
|
||
#Put | ||
echo "Sending PUT request to $host:$port$testPath" | ||
coap-cli put $testPath -H $host -p $port -d $payload | ||
sleep 1 | ||
|
||
#Delete | ||
echo "Sending DELETE request to $host:$port$testPath" | ||
coap-cli delete $testPath -H $host -p $port |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters