Disclaimer: I can’t give you a real explanation why this happens. I investigated this issue multiple times and (like you) didn’t even get a consistent error behavior. Anyway: Every sort of RESTful remote request using a remote API is painful and error prone – it simply highly depends what the counter part gives you… not.
But… sometimes the problem is the SSL
certificate and secure connections simply doesn’t work out.
Disable SSL verification
The (plain stupid) solution to this is to turn it off with the second argument inside the remote request API function:
wp_remote_get( $api_url, array( 'sslverify' => false ) );
Related Posts:
- Validating input using java.util.Scanner
- What is the actual minimum length of an email address as defined by the IETF?
- Server side validation
- Does wp_insert_post validate the input?
- WordPress oEmbed W3C Validation
- How to Remove novalidate attribute from comment form
- What is wp_check_invalid_utf8?
- Data Validation
- Data Validation: Always escape late / escape HTML Code
- Multiple register settings, with same option name – issue
- wordpress site validation errors
- Data validation
- Best Practice for Validating and Sanitizing Data
- Does balanceTags() provide any escaping / protection?
- w3c validation problem – Twitter share button pulling content
- Data sanitization for user registration and user login
- wp_remote_post – handling responses
- What data sanitzation function should be used to store entire source code of webpage?
- protect user submitted posts
- Settings API – getting hidden input / submit button’s name
- Why the WP Core team does not allow filter_* functions? [closed]
- confused about sanitize_email after is_email [duplicate]
- Require user to input code from an array of allowed codes with Gravity Forms [closed]
- Output Sanitation
- How do I sanitize the str_replace function in javascript variables
- WordPress live, custom text box validation, how to?
- How to do more than one verify_nonce in one function?
- W3C validation errors (trailing slashes)
- Jquery Validation Engine with Conatct Form 7
- Gravity Forms validate arrival and departure
- Why is my script’s regex having its backslash removed?
- Validation Always Tells There Is an Open DIV
- How long does plugin review usually take?
- WP calendar summary attribute validation error
- Simple way to alert error messages in Javascript
- How can I validate an email address using a regular expression?
- Good input validation loop using cin – C++
- How can I validate an email address using a regular expression?
- Reactjs – Form input validation
- How to validate an email address in JavaScript
- XAML Binding Groups
- “Stray start tag footer” in html validator?
- A potentially dangerous Request.Form value was detected from the client
- WebForms UnobtrusiveValidationMode requires a ScriptResourceMapping for jquery
- Email validation using jQuery
- How to test valid UUID/GUID?
- what is a parse error and how do I fix it
- Server-side schema validation with JAX-WS
- How to validate date with format “mm/dd/yyyy” in JavaScript?
- Validating IPv4 addresses with regexp
- An invalid form control with name=” is not focusable
- Validate date in dd/mm/yyyy format using JQuery Validate
- How can I check if a string is a valid number?
- HTML5 Validation Error: body start tag seen but an element of the same type was already open
- How can I check if a single character appears in a string?
- What is jQuery Unobtrusive Validation?
- jQuery Form Validation before Ajax submit
- Contact Form 7 – Custom Validation
- How does the SQL injection from the “Bobby Tables” XKCD comic work?
- Hapi/Joi Validation: How to process text to a specific format
- What is the best Java email address validation method?
- Check if inputs are empty using jQuery
- ZIP Code (US Postal Code) validation
- A non well formed numeric value encountered
- validate textfield contents in wordpress simple job board plugin
- Sending JSON string through wp_remote_post()
- Remove type attribute from script and style tags added by WordPress
- In Which Contexts are Plugins Responsible for Data Validation/Sanitization?
- don’t publish custom post type post if a meta data field isn’t valid
- How to check if a string is a valid URL
- Filter any HTTP request URI?
- How to control accept encoding on HTTP API requests?
- How do I mock HTTP requests for PHPUnit?
- How to remove rest api link: in http headers?
- Sanitize and data validation with apply_filters() function
- How to validate custom fields in custom post type?
- How should one implement add_settings_error on custom menu pages?
- How to properly validate data from $_GET or $_REQUEST using WordPress functions?
- How to use the HTTP API with a Proxy?
- Sample code for validating custom metabox?
- Mutual Authentiction on HTTPS with WordPress HTTP API?
- Validation error: Extending Gutenberg gallery block
- Replacing the WordPress password validation
- How to use WordPress HTTP API to download file from remote location
- is_email() VS sanitize_email()
- Check for and enforce unique value in user-entered custom meta field in WP Admin
- How to Debug the ‘save_post’ Action?
- HTTP digest authentication using wp_remote_get
- Hook into WordPress update?
- WordPress REST API validation
- How can I make post fields required in WordPress?
- How to define a query parameter with REST API?
- Require featured image
- Error timed out with succesfull wp_remote_post
- edit profile validation refreshes all field if missing wordpress
- Difference between wp_remote_post and wp_safe_remote_post
- How to run multiple Async HTTP requests in WordPress?
- What is the best practice for escaping data URIs?
- Shortcode putting html such as
- How to consume and display external data in WordPress from another website