Skip to content

Margus Roo –

If you're inventing and pioneering, you have to be willing to be misunderstood for long periods of time

  • Cloudbreak Autoscale fix
  • Endast

Drupal7 services REST request examples

Posted on May 24, 2011 by margusja

List users

[Tue May 24 17:59:59 margusja@IRack curl -v http://hostname/drupal/rest_test/user/
* About to connect() to hostname port 80 (#0)
* Trying 192.168.0.11... connected
* Connected to hostname (192.168.0.11) port 80 (#0)
> GET /drupal/rest_test/user/ HTTP/1.1
> User-Agent: curl/7.19.7 (universal-apple-darwin10.0) libcurl/7.19.7 OpenSSL/0.9.8l zlib/1.2.3
> Host: hostname
> Accept: */*
>
< HTTP/1.1 200 OK < Date: Tue, 24 May 2011 15:00:06 GMT < Server: Apache/2.2.14 (Fedora) < X-Powered-By: PHP/5.2.9 < Expires: Sun, 19 Nov 1978 05:00:00 GMT < Cache-Control: no-cache, must-revalidate, post-check=0, pre-check=0 < ETag: "1306249206" < Vary: Accept < Last-Modified: Tue, 24 May 2011 15:00:06 GMT < Connection: close < Transfer-Encoding: chunked < Content-Type: text/yaml < --- - uid: 1 name: margusja pass: $S$CLdHKPLTL5C9RJC/aduBDDD2flz8nMh96EByixXh.os3ebjxxxx mail: margusja@okia.ee theme: signature: signature_format: created: 1304930237 access: 1306247932 login: 1306247601 status: 1 timezone: language: picture: 0 init: margusja@okia.ee data: uri: http://hostname/drupal/rest_test/user/1 - uid: 0 name: pass: mail: theme: signature: signature_format: created: 0 access: 0 login: 0 status: 0 timezone: language: picture: 0 init: data: uri: http://hostname/drupal/rest_test/user/0 * Closing connection #0 [Tue May 24 18:00:07 margusja@IRack

list user 1

[Tue May 24 18:00:07 margusja@IRack curl -v http://hostname/drupal/rest_test/user/1
* About to connect() to hostname port 80 (#0)
* Trying 192.168.0.11... connected
* Connected to hostname (192.168.0.11) port 80 (#0)
> GET /drupal/rest_test/user/1 HTTP/1.1
> User-Agent: curl/7.19.7 (universal-apple-darwin10.0) libcurl/7.19.7 OpenSSL/0.9.8l zlib/1.2.3
> Host: hostname
> Accept: */*
>
< HTTP/1.1 200 OK < Date: Tue, 24 May 2011 15:02:08 GMT < Server: Apache/2.2.14 (Fedora) < X-Powered-By: PHP/5.2.9 < Expires: Sun, 19 Nov 1978 05:00:00 GMT < Cache-Control: no-cache, must-revalidate, post-check=0, pre-check=0 < ETag: "1306249328" < Vary: Accept < Last-Modified: Tue, 24 May 2011 15:02:08 GMT < Connection: close < Transfer-Encoding: chunked < Content-Type: text/yaml < --- uid: 1 name: margusja pass: $S$CLdHKPLTL5C9RJC/aduBDDD2flz8nMh96EByixXh.os3ebj9xxxx mail: margusja@okia.ee theme: signature: signature_format: created: 1304930237 access: 1306247932 login: 1306247601 status: 1 timezone: language: picture: init: margusja@okia.ee data: false roles: 2: authenticated user 3: administrator rdf_mapping: rdftype: - sioc:UserAccount name: predicates: - foaf:name homepage: predicates: - foaf:page type: rel * Closing connection #0 [Tue May 24 18:02:08 margusja@IRack

Create a new user

[Tue May 24 18:02:08 margusja@IRack curl -v --curl -v --data "account[name]=test&account[mail]=test@test.com&account[pass]=pass" http://hostname/drupal/rest_test/user/
* About to connect() to hostname port 80 (#0)
* Trying 192.168.0.11... connected
* Connected to hostname (192.168.0.11) port 80 (#0)
> POST /drupal/rest_test/user/ HTTP/1.1
> User-Agent: curl/7.19.7 (universal-apple-darwin10.0) libcurl/7.19.7 OpenSSL/0.9.8l zlib/1.2.3
> Host: hostname
> Accept: */*
> Content-Length: 65
> Content-Type: application/x-www-form-urlencoded
>
< HTTP/1.1 200 OK < Date: Tue, 24 May 2011 15:04:03 GMT < Server: Apache/2.2.14 (Fedora) < X-Powered-By: PHP/5.2.9 < Expires: Sun, 19 Nov 1978 05:00:00 GMT < Cache-Control: no-cache, must-revalidate, post-check=0, pre-check=0 < ETag: "1306249443" < Vary: Accept < Last-Modified: Tue, 24 May 2011 15:04:03 GMT < Connection: close < Transfer-Encoding: chunked < Content-Type: text/yaml < --- uid: 5 uri: http://hostname/drupal/rest_test/user/5 * Closing connection #0 [Tue May 24 18:04:04 margusja@IRack

Delete a user

[Tue May 24 18:04:04 margusja@IRack curl -v --data "X DELETE -v http://hostname/drupal/rest_test/user/5
* About to connect() to hostname port 80 (#0)
* Trying 192.168.0.11... connected
* Connected to hostname (192.168.0.11) port 80 (#0)
> DELETE /drupal/rest_test/user/5 HTTP/1.1
> User-Agent: curl/7.19.7 (universal-apple-darwin10.0) libcurl/7.19.7 OpenSSL/0.9.8l zlib/1.2.3
> Host: hostname
> Accept: */*
>
< HTTP/1.1 200 OK < Date: Tue, 24 May 2011 15:05:26 GMT < Server: Apache/2.2.14 (Fedora) < X-Powered-By: PHP/5.2.9 < Expires: Sun, 19 Nov 1978 05:00:00 GMT < Cache-Control: no-cache, must-revalidate, post-check=0, pre-check=0 < ETag: "1306249526" < Vary: Accept < Last-Modified: Tue, 24 May 2011 15:05:26 GMT < Connection: close < Transfer-Encoding: chunked < Content-Type: text/yaml < --- - true * Closing connection #0 [Tue May 24 18:05:26 margusja@IRack

Posted in Linux

Post navigation

My favorite song of Eurovision song contest 2011
Keily lõpetamise pildid 2011

Leave a Reply

You must be logged in to post a comment.

The Master

Categories

  • Apache
  • Apple
  • Assembler
  • Audi
  • BigData
  • BMW
  • C
  • Elektroonika
  • Fun
  • Hadoop
  • help
  • Infotehnoloogia koolis
  • IOT
  • IT
  • IT eetilised
  • Java
  • Langevarjundus
  • Lapsed
  • lastekodu
  • Linux
  • M-401
  • Mac
  • Machine Learning
  • Matemaatika
  • Math
  • MSP430
  • Muusika
  • neo4j
  • openCL
  • Õpetaja identiteet ja tegevusvõimekus
  • oracle
  • PHP
  • PostgreSql
  • ProM
  • R
  • Turvalisus
  • Varia
  • Windows
Proudly powered by WordPress | Theme: micro, developed by DevriX.