From 544937921c0b61aa6821ce0604c02d87f0252685 Mon Sep 17 00:00:00 2001 From: Sasa Zivkov Date: Wed, 29 May 2013 16:43:35 +0200 Subject: [PATCH] Document how to send file content without conversion using curl Change-Id: I45d881bb87e465e826884dd0286b4900fb93059a --- Documentation/dev-rest-api.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Documentation/dev-rest-api.txt b/Documentation/dev-rest-api.txt index 869ac2b830..0175a628ac 100644 --- a/Documentation/dev-rest-api.txt +++ b/Documentation/dev-rest-api.txt @@ -40,6 +40,14 @@ Test data can be included from a local file: curl -X PUT -d@testdata.txt --header "Content-Type: application/json" http://localhost:8080/path/to/api/ ---- +Note that the `-d` option will remove the newlines from the content of the +local file. If the content should be sent as-is then use the `--data-binary` +option instead: + +---- + curl -X PUT --data-binary @testdata.txt --header "Content-Type: text/plain" http://localhost:8080/path/to/api/ +---- + Authentication ~~~~~~~~~~~~~~