Advertisement
Guest User

Untitled

a guest
Jul 21st, 2017
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. http://demo.wp-api.org/wp-json/wp/v2/posts
  2.  
  3. Access-Control-Allow-Headers:Authorization, Content-Type
  4. Access-Control-Expose-Headers:X-WP-Total, X-WP-TotalPages
  5. Allow:GET
  6. Cache-Control:max-age=300, must-revalidate
  7. Connection:keep-alive
  8. Content-Encoding:gzip
  9. Content-Type:application/json; charset=UTF-8
  10. Date:Wed, 28 Dec 2016 12:48:50 GMT
  11. Last-Modified:Wed, 28 Dec 2016 12:48:50 GMT
  12. Link:<https://demo.wp-api.org/wp-json/wp/v2/posts?page=2>; rel="next"
  13. Server:nginx/1.4.6 (Ubuntu)
  14. Transfer-Encoding:chunked
  15. Vary:Cookie
  16. Via:1.1 dfa2cbb51ec90b28f03125592b887c7d.cloudfront.net (CloudFront)
  17. X-Amz-Cf-Id:ri4C3e-AdixwqGv_wYNdGRq9ChsIroy1Waxe2GqkiTqbk4CpiSIQfw==
  18. X-Batcache:MISS
  19. X-Cache:Miss from cloudfront
  20. X-Content-Type-Options:nosniff
  21. X-EC2-Instance-Id:i-198c7e94
  22. X-Powered-By:PHP/7.0.11-1+deb.sury.org~trusty+1
  23. X-Robots-Tag:noindex
  24. X-WP-Total:71
  25. X-WP-TotalPages:8
  26.  
  27. http://demo.wp-api.org/wp-json/wp/v2/posts?per_page=1
  28.  
  29. http://demo.wp-api.org/wp-json/wp/v2/categories
  30.  
  31. headers('X-WP-Total')
  32.  
  33. wp-json/wp/v2/categories?page=1&per_page=5
  34.  
  35. $.get( 'http://demo.wp-api.org/wp-json/wp/v2/posts', function( data, status, request ) {
  36. numPosts = request.getResponseHeader('x-wp-total');
  37. console.log( numPosts ); //outputs number of posts to console
  38. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement