Skip to content

Instantly share code, notes, and snippets.

@jmarmolejos
Created October 16, 2016 17:47
Show Gist options
  • Save jmarmolejos/9687c9c2ec1669674050d15094dcb6d4 to your computer and use it in GitHub Desktop.
Save jmarmolejos/9687c9c2ec1669674050d15094dcb6d4 to your computer and use it in GitHub Desktop.
public class KongAuthHttpClientHandler : HttpClientHandler
{
protected override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
{
var kongUrl = "http://localhost:8000/";
request.RequestUri = new Uri(kongUrl + request.RequestUri.PathAndQuery);
request.Headers.Add("ApiKey", "Rm9vYmFy");
request.Headers.Host = "requestb.in";
return await base.SendAsync(request, cancellationToken);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment