This my solution:
$url="##MYURL##?api_token=##APIKEY##";
$args = array(
'headers' => array( '','cache-control' => 'no-cache', 'content-type' => 'application/json' ),
'body' => '{"pass":{"serial_number":"123456","Name":"Michele","Date":"2017/11/11","Type":"Abb.Annuale","Issued":"Genn.2016","Al":"Dic.2018","Number":"0123456789412"}}',
);
$response = wp_remote_post( $url, $args );
$body = wp_remote_retrieve_body( $response );
var_dump($body);
Related Posts:
- Create custom API endpoint to change custom header image
- Display endpoint’s return into a file (file_put_contents())
- Apply function.php filter only if url not has /amp/
- Hide a div if the fiels is empty
- File from parent theme imported to child theme doesn’t work – any ideas?
- Illegal string offset checkbox
- Ajax filter with loadmore button
- Cant get blog name with get_option
- Problem with displaying CSS Stylesheets – Am I adding them correctly in my wordpress child theme?
- Preventing direct access to a page in WordPress
- How to use data URL in WordPress?
- php code for outputting a custom page in my account
- How can I redefine WordPress wp-content directory programmatically?
- Trim Titles Only On Some Pages
- require get_template_directory() . ‘path/to-my/file.php’ BREAKS customize > themes functionality
- Flushing the slug base has no effect and does not change
- HTML comment cause issue in functions.php script root
- Custom global variable not working in function
- ssl redirect function is not working
- Hide specific shipping methode depending on day and time of day
- Programmatically add a product to the cart and set price to zero when buying from certain category
- I want to show cart items number if any or nothing, simple CART text
- update_user_meta as multiple value but with same meta key
- Adding custom field to product category and show it to shop/category shop page
- Embed video from streamtape using direct link
- Hide payment method based on user role AND minimum cart value
- Is there a PHP function that will return the block ID generated by WordPress?
- Custom plugin: how do I call a PHP file if settings option is set to true?
- How can I prevent a shortcode div from extending beyond its boundaries?
- Creating a Function and Call It
- posts_per_page displays only 2 posts instead of 4 posts
- WooCommerce display price before add to cart [closed]
- How do i post data to url with fields?
- Change lost password url to a mailto URL in WordPress
- PHP multiple forms, same page, isset($_POST[]) not working?
- Get parent category name when only child category is applied to a product
- Show sidebar only to author of post
- Outputting post content to jQuery .html() string
- removing the standard dashboard widgets in WP so I Can replace with custom
- Gravity Forms: How to add PHP function to confirmation conditional shortcode?
- How to change this ajax function to submit to the default wordpress content area instead of the custom field ‘seller notes’?
- wpdb->query returns different value to phpMyAdmin
- shortcodes, custom php and their errors
- Remove span tags from WooCommerce Downloads page
- Trouble Accessing Gravity Forms API (GFAPI)
- How can i avoid duplicate same post in wp?
- Get custom field value from the function.php
- Non-blocking file_put_contents in function.php
- How to move a post from one category to another
- Best way to use variables in multiple functions?
- Child theme overirde template-tags in a theme built on underscores in inc/template-tags
- Trying to add some custom text into WordPress Post title via function.php
- Display a custom name when the user has no name settle in his account
- Having trouble creating two shortcodes, one for logged in user and one for visitors
- Show data obtained from a function and place it in a shortocode function
- register_block_type is not working properly
- How can i create a function tag in my plugin
- Delete post meta by serialized meta value
- PHP “warning include_once(): Failed to open stream” Simple HTML DOM in WordPress Child Theme
- Multiple cron jobs vs daily cron job doing multiple things? Which one yields better performance and scalability?
- Edit a function to take different actions based on user role
- get_the_author_meta( ‘ID’ ) just return 1
- How to put 2 php codes in functions.php without site crashing
- Update $wpdb query with AJAX
- Exclude category from function – PHP
- how to add custom select field to wordpress edit page
- Advance custom fields variable with if statement & Function
- How to change order inside foreach using wp_enqueue_script?
- In a foreach loop, how can I add a meta value if it doesn’t exist?
- Change header on one page in WordPress
- Restrict wordpress access to logged users only
- Can an AJAX callback function access a PHP variable which was defined during initial page load?
- Custom meta box is not displaying value showing tag as empty
- How to override theme’s public static function inside of a trait?
- How to escape echo for input tag?
- Discount in the specific product title using keyword ( Woocoommerce )
- Menu not updating for logged in users after redirect
- Delete empty title_tags, find a h1 heading and echo it
- Including user data in “new user notification email”
- I got big white screen when i attach main style sheet of Html in functions.php
- Using Javascript On Page – Header and Footer Now Missing
- Notice: Undefined variable
- Extra editor on top of default in Custom Post Type
- How do I fix Undefined variable using $_POST in function?
- Create a temporal post
- cURL needing to loop through all “next_page”
- Enqueue sripts and styles only if function is called
- Woocommerce – if selected attribute term equals
- split 1 cart item into instock and back ordered
- How to bind each “the_content” elements to a custom variables
- post_exists stops working in a scheduled event
- Permalink changes after several minutes after saving post
- how to use auth_redirect() redirect visitor to login page if they are not login when they click account and order page?
- Hide a specific category title from displaying on site
- Send POST request to Flask app from functions.php file
- Adding product permalink on admin order page throwing error
- Before & After Content – After Content directly below Before Content when using require_once
- How do I get the value of a current user’s custom field?
- 500 Error, Get custom field and returning it
- Adding extra data to shortcode attributes and pass it to JS with wp_localize_script