HoneyBear.HalClient
HoneyBear.HalClient copied to clipboard
Retrieve single objects
Hi, i found your library and the api looks very nice for consuming hal based rest apis.
I have two questions regarding the api usage:
- Retrieve a single resource My Resource:
{
"_embedded" : {
"users" : [ {
"id" : 2,
"name" : "asddf",
"_links" : {
"self" : {
"href" : "http://localhost:8080/users/2"
},
"user" : {
"href" : "http://localhost:8080/users/2"
},
"address" : {
"href" : "http://localhost:8080/users/2/address"
}
}
} ]
},
"_links" : {
"self" : {
"href" : "http://localhost:8080/users{?page,size,sort}",
"templated" : true
},
"profile" : {
"href" : "http://localhost:8080/profile/users"
}
},
"page" : {
"size" : 20,
"totalElements" : 1,
"totalPages" : 1,
"number" : 0
}
}
How do i get the user resource with id 2 without fetching everything and traverse through the result? I am looking for a single http request solution to get /users/2 into my user dto.
- How is error handling solved? How do i check for all the http error codes and messages e.g.: /users/3 => 404 or with detailed json result.