aboutsummaryrefslogtreecommitdiffstats
path: root/escape.c
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2018-04-04 18:53:56 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2018-12-13 14:12:02 +0100
commit16377de92c254202ab62d4118f94014ced06af14 (patch)
tree0b51db320d76c3abbef4018cc269983239babc47 /escape.c
parentc4adbcb905dc37e4d8773cea6a77cbec3e1a02f8 (diff)
POST using unescaped arguments
Add the ability to make a POST request without urlencode the arguments. This will only concatenate them instead. You can also specify the used separator. Change-Id: Icb61a5a20771a89e89159132365d86ee4c982d1c Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'escape.c')
-rw-r--r--escape.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/escape.c b/escape.c
index 3bb25c2..f370fc9 100644
--- a/escape.c
+++ b/escape.c
@@ -313,6 +313,12 @@ char *escape_args(const char * const *args, size_t *length)
return escape_url(NULL, NULL, args, length);
}
+const char *escape_str(const char* str, size_t *length)
+{
+ const char *a[2] = { str, NULL };
+ return escape_args(a, length);
+}
+
const char **unescape_args(const char *args)
{
const char **r, **q;