According to the curl page man -d is the same as -data-ascii. To publish data in binary, use -data-binary and to publish using url encoding, use -data-urlencode. Since your file is not URL encoded, if you want to send its URL encoding, use:
curl --data-urlencode @file http:
If the file contains something like:
00:0f:1f:64:7d:ff 00:0f:1f:64:7d:ff 00:0f:1f:64:7d:ff
this will cause the POST request to get something like:
POST / HTTP/1.1 User-Agent: curl/7.19.5 (i486-pc-linux-gnu) libcurl/7.19.5 OpenSSL/0.9.8g zlib/1.2.3.3 libidn/1.15 Host: example.com Accept: */* Content-Length: 90 Content-Type: application/x-www-form-urlencoded 00%3A0f%3A1f%3A64%3A7d%3Aff%0A00%3A0f%3A1f%3A64%3A7d%3Aff%0A00%3A0f%3A1f%3A64%3A7d%3Aff%0A
If you want to add a name, you can use multi-page form encoding, for example:
curl -F MACS=@file http:
or
curl -F MACS=<file http:
source share