Skip to content

5. HTTP Request Java 2

Milena edited this page Aug 7, 2022 · 3 revisions

Find Greeting from Server @Author: Tran Anh Hoang

GET http://localhost:8080/api/getHello
Accept: text/plain

Find all Data from person with personId = 1 @Author: Tran Anh Hoang

GET  http://localhost:8080/api/SearchingResource/findPerson/1
Accept: application/json

Find all person in Database @Author: Tran Anh Hoang

GET  http://localhost:8080/api/SearchingResource/findAllPerson
Accept: application/json

Find certain Avater in Database through personAvatarId @Author: Tran Anh Hoang

GET  http://localhost:8080/api/SearchingResource/findPersonAvatar/3
Accept: application/json

Find all person with UserInput @Author: Tran Anh Hoang

GET  http://localhost:8080/api/SearchingResource/findPersonBy/Max/Mustermann/AI/GTI
Accept: application/json

Find all person with deleted Flag @Author: Tran Anh Hoang

GET  http://localhost:8080/api/SearchingResource/findAllPersonWithDeletedFlag
Accept: application/json

Find all person without deleted Flag @Author: Tran Anh Hoang

GET  http://localhost:8080/api/SearchingResource/findAllPersonWithOutDeletedFlag
Accept: application/json

Find all person without same Address @Author: Tran Anh Hoang

GET  http://localhost:8080/api/SearchingResource/findAllPersonWithEqualAddressId/Altonaer Strasse 25/Erfurt/99085
Accept: application/json

Update person @Author: Tran Anh Hoang

POST http://localhost:8080/api/EditingPersonResource/UpdatePerson
Content-Type: application/json
Accept: application/json
{
  "id": 1,
  "version": 0,
  "created": 1659783879368,
  "firstname": "Jenny",
  "lastname": "Mustermann",
  "email": "[email protected]",
  "phonenumber": null,
  "title": null,
  "hireDate": null,
  "teachingFlag": null,
  "room": null,
  "major": "AI",
  "immatriculationDate": "21.10.2021",
  "exmatriculationDate": null,
  "tutorFlag": false,
  "scientificWorkerFlag": false,
  "jobTitle": null,
  "deletedFlag": false,
  "address": {
    "id": 2,
    "version": 0,
    "created": 1659783879413,
    "street": "Altonaer Strasse 25",
    "city": "Erfurt",
    "zipCode": "99085"
  },
  "facultyName": {
    "id": 4,
    "version": 0,
    "created": 1659783879424,
    "facultyName": "GTI"
  }
}

Create person @Author: Tran Anh Hoang

POST http://localhost:8080/api/EditingPersonResource/createPerson
Content-Type: application/json
Accept: application/json
{
  "firstname": "Hannah",
  "lastname": "Mustermann",
  "email": "[email protected]",
  "phonenumber": null,
  "title": null,
  "hireDate": null,
  "teachingFlag": null,
  "room": null,
  "major": "Bauingenieur",
  "immatriculationDate": "01.10.2021",
  "exmatriculationDate": null,
  "tutorFlag": false,
  "scientificWorkerFlag": false,
  "jobTitle": null,
  "deletedFlag": false,
  "address": {
    "street": "Altonaer Strasse 25",
    "city": "Erfurt",
    "zipCode": "99085"
  },
  "avatar": null,
  "facultyName": {
    "facultyName": "Gebaeudetechnik und Informatik"
  }
}

Delete person @Author: Tran Anh Hoang

DELETE http://localhost:8080/api/EditingPersonResource/deletePerson/1
Content-Type: application/json
Accept: application/json

Delete addressById @Author: Milena Neumann

DELETE http://localhost:8080/api/EditingAddressResource/deleteAddress/2
Content-Type: application/json
Accept: application/json

Find an address by Id @Author: Milena Neumann

GET  http://localhost:8080/api/SearchingResource/findAddressById/6
Accept: application/json

Find person by addressId @Author: Milena Neumann

GET  http://localhost:8080/api/SearchingResource/findPersonByAddressId/2
Accept: application/json

Find persons by facultyName @Author: Milena Neumann

GET  http://localhost:8080/api/SearchingResource/findAllPersonsByFaculty/GTI
Accept: application/json