Merge pull request #15281 from chrysn-pull-requests/cli-postput-payload-is-optional

examples/gcoap: Allow PUT/POST with empty payload
This commit is contained in:
chrysn 2020-10-23 15:21:43 +02:00 committed by GitHub
commit f84d34f2be
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -373,7 +373,8 @@ int gcoap_cli_cmd(int argc, char **argv)
if (((argc == apos + 2) && (code_pos == 0)) || /* ping */
((argc == apos + 3) && (code_pos == 1)) || /* get */
((argc == apos + 4) && (code_pos > 1))) { /* post or put */
((argc == apos + 3 ||
argc == apos + 4) && (code_pos > 1))) { /* post or put */
char *uri = NULL;
int uri_len = 0;