icarus-consulting / Yaapii.Http

C# Library for Http Request
MIT License
7 stars 0 forks source link

Make accessing single header values easier #36

Closed DFU398 closed 4 years ago

DFU398 commented 4 years ago

Expected Behavior

If you are sure that a header has exactly one value, or you just need the first of several values, it can be accessed with

new Header.FirstOf(response, "header key").AsString()

Similar *.FirstOf classes exist for specialized headers, e.g. BearerTokenAuth.FirstOf etc.

Actual Behavior

new FirstOf<string>(
    new Header.Of(response, "header key")
).Value()

Mention any other details that might be useful

Steps to reproduce the behavior

The log given by the failure.