Making an explicit mapping

When i want to make a mapping in command line i always get an empty mapping back while it works perfectly in my sense extension.
This is what i do

curl -XPUT http://localhost:9200/twitter -d mapping.json
curl -XGET http://localhost:9200/twitter/_mapping/?pretty=1

this is what my last command returns:
"{
"twitter": {
"mappings" : { }
}
}

Does anyone know what i'm doing wrong?
Even when i try it with the original data from the tutorial it keeps outputing the same empty mappings.

This is the content of my maping.json file:
{
"mappings": {
"appconsole" : {
"_timestamp": {
"enabled": true,
"store": "yes"
},
"_version": {
"type": "string"
},
"dynamic": "strict",
"properties" : {
"message": {
"type": "string"
},
"Log_Level2": {
"type": "string"
},
"errormsg": {
"type": "string"
},
"geoip": {
"dynamic" : "true",
"properties" : {
"ip" : {
"type" : "ip"
},
"latitude" : {
"type" : "float"
},
"location" : {
"type" : "geo_point"
},
"longitude" : {
"type" : "float"
}
}
},"date" : {
"type" : "date",
"format": "yyyy/MM/dd"
},
"highTime" : {
"type" : "string"
},
"lowTime" : {
"type" : "string"
},
"package" : {
"type" : "string"
},
"Log_Level" : {
"type" : "string"
}
}
}
}
}

original data from tutorial:
{ "mappings" : { "twitter" : {"properties" : { "message" : { "type" : "string", "store" : "true" }}}}}

Please format your code.

That's not how curl is working.

IIRC you have to use @filename.json or something like this.

If i use curl -XPUT http://localhost:9200/twitter -d @mapping.json
with the original data from the tutorial

{ "mappings" : { "twitter" : {"properties" : { "message" : { "type" : "string", "store" : "true" }}}}}

i get
{"acknowledged":true}curl: (6) Couldn't resolve host 'mappings'

Any ideas?

@dadoonet
Thanks for the idea it was indead a wrong format of the curl command.

It should have been curl -XPOST --upload-file mapping.json http://localhost:9200/twitter/