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

Feature to give the count of total posts without actually retrieving them #286

Closed navjot50 closed 2 years ago

navjot50 commented 2 years ago

Added the feature to give count of total posts without loading all of them in memory.

A HEAD request is made to the WordPress REST API which gives back all the headers without any response payload. Then the value of X-WP-TOTAL header is returned.

This PR is a minimal solution to https://github.com/wp-net/WordPressPCL/issues/255

delasource commented 1 year ago

this should be added to CustomRequest as well