wp-net / WordPressPCL

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

Cannot use API while Site DNS hosted in Cloudflare #172

Closed RajaduraiAz closed 5 years ago

RajaduraiAz commented 5 years ago

I get a exception while trying to get all post. After some search I fount, Cloudflare block request which doesn't contain user-agent header. Then I checked source code it doesn't contain any code for adding user-agent header.

There is any way to add custom header while request API?

RajaduraiAz commented 5 years ago

I checked out source code and added user-agent header in Get and Post request handler. Now it;s working fine.