wp-net / WordPressPCL

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

WordPressClient with HttpClient posts to incorrect URL #263

Open ChivanTiebosch opened 3 years ago

ChivanTiebosch commented 3 years ago

When using the WordPressClient(HttpClient httpClient, string defaultPath = DEFAULT_PATH) constructor the WordPressUri is set based on the httpClient.BaseAddress and a trailing / is added. However, the httpClient passed to the HttpHelper still has the URI without the leading "/" (valid URI format needs to be this). Therefore the generated URLs in the Client based on DEFAULT_PATH (changeable) and _jwtPath (read-only) are incorrect.