Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mention usage of http request headers in readme. #333

Merged
merged 1 commit into from
Dec 14, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,27 @@ var serializer = new JsonNetApiClientSerialization();
serializer.DefaultOptions.IgnoreNullValues = false;
```

### HTTP Request Headers

APIs that support specifying HTTP request headers have an optional method argument to pass in header values.

For example, to specify a stream transaction ID when creating a document:


```csharp
await adb.Document.PostDocumentAsync(
"MyCollection",
new MyClass
{
ItemNumber = 123456,
Description = "Some item"
},
new DocumentHeaderProperties()
{
TransactionId = "0123456789"
});
```

### API Errors

Any time an endpoint responds with an HTTP status code which is not a "success" code, an `ApiErrorException` will be thrown. You may wish to wrap your API calls in a try/catch block, and catch `ApiErrorException` in certain circumstances.
Expand Down