Short answer to a long question:
I needed quotation marks round the URL.
curl -X GET "https://example.com/wp-json/foo/v1/bar?posts_per_page=1&paged=2" -H "Authorization: Basic xxxxx"
Related Posts:
- Can we access the REST request parameters from within the permission_callback to enforce a 401 by returning false?
- What’s the right way to validate JSON data coming from an AJAX POST request?
- Is the WordPress REST API installed and enabled in a vanilla WordPress 4.7 installation?
- check the requesting url
- WP REST API Require Password for GET Endpoint
- How to use _embed when using _fields?
- WP REST API V2 – Retrieve sub page by full slug (URL/Path)
- Filter posts by multiple custom taxonomy terms using AND operator in REST API v2 (WordPress)
- WP REST API core major changes
- How to get all posts from parent and children categories?
- How to use the WP REST API for new user registration (sign up form)?
- Can I authenticate with both WooCommerce consumer key and JWT?
- Attach featured image to custom endpoints
- WordPress: How to create custom REST API route?
- WP REST API: check if user is logged in
- REST API URL parameters not working with apache server
- Adding post fields in wp-json/wp/v2/search
- Unable to get the info of the user which doesn’t have created any post via REST API
- WordPress Gutenberg get page template value when post updated?
- Can’t GET draft posts via REST API from headless frontend
- How to update custom meta fields with rest api?
- Query the REST API for a Tag by slug
- Rest API Custom Endpoint with space character
- apiFetch security
- Rest API and Custom Fields
- WordPress REST API, Expired Nonce from Cache results in 403 forbidden
- WP Rest API: Get User by Email
- Application Password is not enable by default?
- Gutenberg Custom Block Getting All Posts
- Can we assume that /wp-json/ will always be /wp-json/ under any circumstances when creating custom REST routes?
- Passing a borrowed nonce through Postman fails
- How to hook into “register_rest_field” to modify the behavior of a custom field?
- Get all PDF files from page with WordPress API
- current_user_can(‘administrator’) returns false when I’m logged in
- How to add / embed an author into REST data from a custom post type?
- WordPress REST API json – How to activate gzip compression?
- How to enable the view of revisions of post in WordPress Api for custom post type?
- Problem on creating custom endpoints for REST
- New user signup via REST API
- Ho to style post content for WordPress API?
- WordPress custom endpoint returning blank response
- How to force JWT auth for default GET endpoints of WordPress rest api?
- WP REST API can’t set post tags
- WP API post__not_in is not working
- WP_REST_Response() doesn’t seem to return the expected object
- Setting ?context=edit results in rest_forbidden_context, even for an Administrator user
- WP Rest Api- Update callback (POST request) to existing database table through the rest api
- Save default options as an array of options and display in REST API
- Sidebar endpoint using WordPress API
- Get custom posts in gutenberg block
- [Zapier + WP Webhooks Pro]: Custom Fields get cut off at first comma or semicolon
- Which route in the WP REST API do I access data passed into register_setting()?
- How to use Python to create a Post in WordPress?
- Getting 401 (access denied) when trying to use the REST API
- Best Authetication between REST API and Mobile App
- Replace content via rest api only?
- WP Rest API – Change response status code for failed validation request
- Unable to create a Rest end-point
- Log in user using WordPress REST API
- WordPress REST API not working on localhost
- /wp-json/wp/v2/posts/?app=3 is returning random scripts tags
- User following system via REST API
- REST API – Allow /users endpoint depending on a custom capability
- 403 Error When Fetching Data from the Settings Rest Route for Non-Admin Users
- REST API post times out when content is too large
- Can I overwrite default WordPress Json API For no more pages text
- Secure WordPress API, how?
- Create User with Profile and Cover Images using REST API
- WordPress Rest Api rest_cannot_edit
- Media gallery images url instead of ID on WP API
- Getting 401 unauthenticated error in WP Rest API revisions
- Remove unwanted fields from WP API response
- WordPress and React how to integrate? [closed]
- WordPress API “code”:”rest_no_route” with Custom Route
- Remote publishing using WP’s RetAPI // Issues with HTACCESS
- save_post hook error with REST API
- Connecting WordPress with an External API
- Users REST API not working?
- WordPress Update Role using API Cross site
- Rest API. Post content
- Error rest_post_invalid_page_number trying to call Rest API
- Is it possible to combine two rest endpoints in the url?
- use WordPress Rest API to build a web application
- REST Request Post including meta/custom fields
- Redefine REST API variables
- How to use WordPress rest API with Angularjs 4 [closed]
- Retrieve posts by page in wp rest api
- Where is the HTML content for my post in the API
- How to change WordPress api v2
- REST API Integration without user account?
- WordPress Rest API Escapes Returned URLs Forward Slash
- WP_REST_Request::get_json_params() Parsing null as Zero
- WP REST API with Basic Auth at target website
- API request forbidden when requesting from same domain
- Custom WP Rest API Endpoints from JSON Schema
- Script tag in string in wordpress rest api body to create post
- How to cache WordPress oembed links in the page header?
- REST API – Authentication/Logon security
- Restrict Image Sizes and Dimensions when Uploading via the WP Mobile App
- Can I use the Backbone REST API client outside WordPress?