wp-net / WordPressPCL

This is a portable library for consuimg the WordPress REST-API in (almost) any C# application
MIT License
335 stars 131 forks source link

Add parameter "useAuth" for CustomRequest.Create #259

Closed tamper2 closed 3 months ago

tamper2 commented 3 years ago

For usage with custom plugins or php code. For example, I'm trying to use this plugin: https://wordpress.org/plugins/bdvs-password-reset/ And I can't because all the requests are POST with no authentication headers. I've had to create my own HTTP POST method for this specific case.

Could change the signature of CustomRequest to be: public async Task<TOutput> Create<TInput, TOutput>(string route, TInput Entity, bool useAuth = true) where TOutput : class

And pass useAuth to HttpHelper (like in Get method).

navjot50 commented 2 years ago

The method you mentioned uses authentication headers by default, so there is no need of optional useAuth argument. What is the error message that you get?

ThomasPe commented 3 months ago

stale