Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
Adding a brief description of path bound objects to the readme
  • Loading branch information
nhart12 authored Nov 14, 2019
1 parent 335b122 commit 2c77a1d
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,19 @@ If the name of your parameter doesn't match the name in the URL path, use the
Task<List<User>> GroupList([AliasAs("id")] int groupId);
```

A request url can also bind replacement blocks to a custom object

```csharp
[Get("/group/{request.groupId}/users/{request.userId}")]
Task<List<User>> GroupList(UserGroupRequest request);

class UserGroupRequest{
int groupId { get;set; }
int userId { get;set; }
}

```

Parameters that are not specified as a URL substitution will automatically be
used as query parameters. This is different than Retrofit, where all
parameters must be explicitly specified.
Expand Down Expand Up @@ -104,6 +117,7 @@ Task<List<Page>> Search(string page);
Search("admin/products");
>>> "/search/admin/products"
```

### Dynamic Querystring Parameters

If you specify an `object` as a query parameter, all public properties which are not null are used as query parameters.
Expand Down

0 comments on commit 2c77a1d

Please sign in to comment.