Skip to content

Instantly share code, notes, and snippets.

@rknLA
Created October 3, 2012 01:08
Show Gist options
  • Save rknLA/3824309 to your computer and use it in GitHub Desktop.
Save rknLA/3824309 to your computer and use it in GitHub Desktop.
multiple sensors
curl -v http://localhost:3000/api/devices.json -d 'api_key=pWUgEvvPer5szyZAfq3D' -X POST -d 'device[manufacturer]=Safecast' -d 'device[model]=epic' -d 'device[sensor_ids][]=2' -d 'device[sensor_ids][]=3'
* About to connect() to localhost port 3000 (#0)
* Trying 127.0.0.1... connected
* Connected to localhost (127.0.0.1) port 3000 (#0)
> POST /api/devices.json HTTP/1.1
> User-Agent: curl/7.21.4 (universal-apple-darwin11.0) libcurl/7.21.4 OpenSSL/0.9.8r zlib/1.2.5
> Host: localhost:3000
> Accept: */*
> Content-Length: 123
> Content-Type: application/x-www-form-urlencoded
>
< HTTP/1.1 201 Created
< Location: http://localhost:3000/en-US/my/measurements/new
< Content-Type: application/json; charset=utf-8
< X-UA-Compatible: IE=Edge
< ETag: "1eaa1db6b5094dec26149536fdf53992"
< Cache-Control: max-age=0, private, must-revalidate
< Set-Cookie: _safecast_session=BAh7B0kiD3Nlc3Npb25faWQGOgZFRkkiJWQ3ZjA0MDA3M2Q1NWQzYWVlY2JlMzFiMDMwZjRmZjY0BjsAVEkiGXdhcmRlbi51c2VyLnVzZXIua2V5BjsAVFsISSIJVXNlcgY7AEZbBmkGSSIiJDJhJDEwJC9QOHNMZVNJRlZsSHdPcy9HL01lLk8GOwBU--19044cf5732aea666e6a6c4b854a2e141b335403; path=/; HttpOnly
< X-Request-Id: 7a75c54526a54fbb7254b8791f8190d3
< X-Runtime: 10.292610
< Content-Length: 291
< Connection: keep-alive
< Server: thin 1.4.1 codename Chromeo
<
* Connection #0 to host localhost left intact
* Closing connection #0
{"id":8,"manufacturer":"Safecast","model":"epic","serial_number":null,"sensors":[{"id":2,"manufacturer":"flubby","measurement_category":"air","measurement_type":"stuff","model":"flab"},{"id":3,"manufacturer":"flubby","measurement_category":"air","measurement_type":"things","model":"chub"}]}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment