Skip to content

Instantly share code, notes, and snippets.

@pauladam
Last active December 16, 2015 03:59
Show Gist options
  • Select an option

  • Save pauladam/5373806 to your computer and use it in GitHub Desktop.

Select an option

Save pauladam/5373806 to your computer and use it in GitHub Desktop.
curl_easy_escape tester.
#include <stdio.h>
#include <curl/curl.h>
int main(int argc, char *argv[])
{
CURL *curl;
CURLcode res;
char *ch;
int length = 0;
curl = curl_easy_init();
ch = (char*) curl_easy_escape(curl, argv[1], 0);
printf("%s", ch);
printf("\n");
return 0;
}
@pauladam
Copy link
Copy Markdown
Author

$: gcc -lcurl -o curl-easy-escape-test curl-easy-escape-test.c
$: ./curl-easy-escape-test "param data \0\0\0"
param%20data%20%5C0%5C0%5C0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment