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
- Good input validation loop using cin – C++
- How to validate an email address in JavaScript
- A potentially dangerous Request.Form value was detected from the client
- Server-side schema validation with JAX-WS
- How can I check if a single character appears in a string?
- What is jQuery Unobtrusive 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?
- A non well formed numeric value encountered
- validate textfield contents in wordpress simple job board plugin
- Remove type attribute from script and style tags added by WordPress
- How to check if a string is a valid URL
- Sample code for validating custom metabox?
- Check for and enforce unique value in user-entered custom meta field in WP Admin
- How to Debug the ‘save_post’ Action?
- How can I make post fields required in WordPress?
- How to run multiple Async HTTP requests in WordPress?
- What is the best practice for escaping data URIs?
- Remove frameborder attribute from iframes
- Stop the form of beign submitted on “Save changes” custom option page
- How to set charset for wp_remote_post request?
- How to load some jquery code to make validation in the theme customizer?
- validate a metabox based on the category that is selected
- Frontend Post Form Validation
- How deactivate the http-api
- Calling JavaScript file with Custom Plugin
- wooCommerce checkout page State / County (optional) validate not working
- wp remote post getting a 404 error code
- New custom theme option (text input) giving index error
- Can I use custom CSS and js plugin to put JavaScript in to validate my forms
- What esc_ to use to validate this?
- What data validation we must use in different contexts?
- Unable to sanitize in customizer and escape in theme without removing ability for user to use “< br >” to insert a line break
- WooCommerce Custom Product Validation [closed]
- Add ALT attribute to Pin It Button image to pass HTML5 validation
- Can a shortcode included in post content add styles to the ?
- Sanitizing text fields in array
- allow only lowercase user registrations
- Warn user that data may be lost for custom pages
- Custom block Block Validation failure w/ deprecation declared
- External HTTP API calls slowing down WordPress admin [closed]
- Custom Block – save.js function not saving attributes
- Disable woocommerce PLACE ORDER button if user selected products that are not available for international delivery
- Remove comments validation (remove filter?)
- contact form in template with jquery,validate and ajax
- WordPressUser Submission Form
- How to validate inputs with filter in register_setting callback
- Code for front end validation for forms not working
- Add Server Side validation in Ajax mail form
- How do I change the text content of a div for a comment validation error message?
- Call external API in wordpress based on user input
- Making custom meta box required (with error message if not filled in) on Gutenberg
- How to save Checkbox-Options in Plugin Options Page
- jQuery Validation plugin and Bootstrap 4 CSS classes
- how to add security questions on wp-registration page and validate it
- WordPress login form with fancybox
- How to format the various types of custom fields?
- Remove WordPress default registration client side validation?
- Settings api sanatize callback not being triggered
- Block pattern conflict with custom block
- WP Debug enabled Undefined index error in a widget
- Create plugin/function to catch XML-data via Shortcode
- why is kses removing semicolon from inline style?
- oneOf JSON Schema validation not properly working for custom post meta value?
- Display notice in block editor after wp_insert_post_data hook