Date post: | 30-Jul-2015 |
Category: |
Internet |
Upload: | maximilian-berghoff |
View: | 315 times |
Download: | 0 times |
WHO AM I?Maximilian Berghoff
Mayflower GmbH (Würzburg)
<!DOCTYPE html><html><head lang="en"> <meta charset="UTF8"> <title>Information</title></head><body> <h1>Information about this page</h1> <p>Here you will get your information</p></body></html>
Content der Response
STATUS CODES1XX - Bearbeitung dauert an (Intermediate)2XX - Anfrage Erfolgreich3XX - Umleitungen4XX - Fehler in der Anfrage/beim Client5XX - Fehler am Server
POST /users HTTP/1.1Host: www.example.devContentType: application/json
"firstName": "Max", "lastName": "Berghoff"
POST request
HTTP/1.1 201 CreatedContentType: application/json;ContentLocation: /users/3
"id": "3", "firstName": "Max", "lastName": "Berghoff"
POST response
PUT /users/3 HTTP/1.1Host: www.example.devContentType: application/json
"firstName": "Max", "lastName": "Berghoff", "email": "[email protected]"
PUT request
HTTP/1.1 200 OKContentType: application/json;
"id": "3", "firstName": "Max", "lastName": "Berghoff", "email": "[email protected]"
POST response
DISERTATIONARCHITECTURAL STYLES AND THE DESIGN OF NETWORK-BASED SOFTWARE ARCHITECTURES
DOCTOR OF PHILOSOPHY, 2000
JEDE INFORMATION KANNRESOURCE SEIN
(HTML) DokumentBildListe von Resourcen
Alles was Ziel einer Referenz/eines Link sein kann.
"userId": "3", "username": "ElectricMaxxx", "firstName": "Max", "lastName": "Berghoff", "email": "[email protected]"
User als JSON
<user> <userId>3</userId> <userName>ElectricMaxxx</userName> <firstName>Maximilian</firstName> <lastName>Berghoff</lastName> <email>[email protected]</email></user>
User als XML
<ul> <li> <strong>Username: </strong> ElectricMaxxx </li> <li> <strong>FirstName: </strong> Max </li> <li> <strong>LastName: </strong> Berghoff </li> <li> <strong>Email: </strong> [email protected] </li></ul>
User als HTML in einem Profil
IM HEADERGET /users/3Content-Type: application/jsonOder Content-Type: application/xmlOder Content-Type: text/html
<?xml version="1.0"?><user> <userName>ElectricMaxxx</userName> <firstName>Maximilian</firstName> <lastName>Berghoff</lastName> <email>[email protected]</email> <link rel="groups" href="/users/3/groups" /> <link rel="roles" href="/users/3/roles" /> <link rel="orders" href="/users/3/orders" /></user>
"_links": "self": "href": "/users/3" ,"userId": "3","_embedded": "orders": [ "_links": "self": "href": "users/3/orders/123" ], "groups": [ "_links": "self": "href": "users/3/orders/2" ]
GET /users/3 HTTP/1.1Host: www.expamle.devContentType: application/xml
Request auf User mit der ID 3
HTTP/1.1 200 OKContentType: application/xml
<?xml version="1.0"?><user> <userName>ElectricMaxxx</userName> <firstName>Maximilian</firstName> <lastName>Berghoff</lastName> <email>[email protected]</email> <link rel="groups" href="/users/3/groups" /> <link rel="roles" href="/users/3/roles" /> <link rel="orders" href="/users/3/orders" /></user>
Anwort des Services in XML
QUESTIONS ?Ask now!Twitter: @ElectricMaxxxMail: [email protected]