Open WesJM opened 5 years ago
You may want to derive your own implementation from WikiClient
class, overriding WikiClient.CreateHttpRequestMessage
. For example:
public class MyWikiClient : WikiClient
{
// ... any class constructors here
protected override HttpRequestMessage CreateHttpRequestMessage(string endPointUrl, WikiRequestMessage message)
{
var httpRequest = base.CreateHttpRequestMessage(endPointUrl, message);
// Unconditionally adds a header to all the HTTP requests sent to the MediaWiki API endpoint.
httpRequest.Headers.Add("Header", "Value");
return httpRequest;
}
}
Sorry about my lack of SAML authentication knowledge to properly address the situation in the code. While I'm looking for some introductory material for this, perhaps you might get some rough idea from the example above 🌚
Plus,
No apologies...I truly appreciate all your work for the API. Thank you for the suggestion and example! :)
You are welcome. Anyway, I will try to keep this issue updated in future.
I'm trying to access a wiki that uses SAML authentication. Is there a method to include/add headers to a the WikiSite request?