# Difference between curl -d \`data\` and curl -d @file

**URL:** <https://discuss.elastic.co/t/difference-between-curl-d-data-and-curl-d-file/13906>\
**Category:** Elasticsearch\
**Created:** [October 10, 2013, 12:24pm UTC](https://discuss.elastic.co/t/difference-between-curl-d-data-and-curl-d-file/13906 "2013-10-10T12:24:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Oliver\_B\_Fischer](https://avatars.discourse-cdn.com/v4/letter/o/f04885/32.png) [@Oliver\_B\_Fischer](https://discuss.elastic.co/u/Oliver_B_Fischer)\
**Post date:** [October 10, 2013, 12:24pm UTC](https://discuss.elastic.co/t/difference-between-curl-d-data-and-curl-d-file/13906/1 "2013-10-10T12:24:07Z")

</div>

I would like to convert my configuration files for ElasticSearch from  
JSON to YML.

I am using curl for all REST related opertions overhanding the file via

$ curl -X PUT [http://localhost:9200/newindex](http://localhost:9200/newindex) -d @file.yml

While this is working for JSON files it is not working for YML  
configuration files. In the first moment I thought it is because of  
Content-Type: application/x-www-form-urlencoded implied by -d. But  
surprisingly the following statement works:

$ curl -X PUT [http://localhost:9200/newindex](http://localhost:9200/newindex) -d '$(cat file.yml)'

So, what do I miss?

Bye,

Oliver

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 2:13am UTC](https://discuss.elastic.co/t/difference-between-curl-d-data-and-curl-d-file/13906/2 "2017-07-06T02:13:01Z")

</div>


