you can create a new API route like that :
add_action("rest_api_init", function () {
register_rest_route(
"test_api"
, "reading_http_json"
, [
"methods" => WP_REST_Server::EDITABLE, // POST PUT PATCH
"callback" => function (WP_REST_Request $request) {
$body = file_get_contents("php://input");
$json = json_decode($body, TRUE);
// here you have data in the array $json
return NULL;
},
"permission_callback" => fn (WP_REST_Request $request) => TRUE,
]
);
});
You give the url https://server/wp_directory/wp-json/test_api/reading_http_json
in their portal and then you receive the data in the array $json
.
Related Posts:
- Automatically determine minimum WordPress version required for a plugin?
- Create a custom admin page for custom post type + taxonomies + metas
- Is There A Hook To Process The Content Of The Text Widget?
- When is wp_loaded initiated only with admin or only when user enters the site or both?
- Preferred way to include Advanced Custom Fields in a plugin?
- How to link to images in my plugin regardless of the plugin folder’s name
- ERROR: Options page not found – saving settings page with tabs
- Can I leave out `if ( ! defined …)` when defining plugin constants?
- Gutenberg is there a way to know if the current block is reusable?
- WordPress Ajax callback function from plugin – OOP
- Is there any way to have Featured Text, as opposed to Featured Image?
- StackExchange clone using WordPress?
- Custom url for a plugin page add_rewrite_rule WordPress
- Custom attribute type not displaying terms in edit product – WooCommerce
- How do I add a prefix when a user registers
- Short code not working in boostrap modal dont no why?
- how to get link of added document with a post
- Doubts about the use of metadata and how this can affect performance on WordPress
- How can I replace content in the WP Admin area before an admin page is rendered?
- update_post_meta not working in a loop
- When is the proper time to minify css and js with git workflow?
- Get draggable widgets on Edit Post page
- Valid filenames for add_action’s first parameter
- What to hook into to check a value before a post is published?
- Correct syntax for database inserts from plugin?
- How to add a gradient component to a custom block
- wp_schedule_event() set daily, but processed every second
- Can’t get AJAX call working in custom plugin
- Custom avatars in wordpress comments?
- $wpdb->update() always need a second try
- Why aren’t some plugin styles loading when I load a template?
- How to create custom dynamic url
- Pagination not working with custom wp_query
- Any way to update_post_meta with html content? It gets stripped and becomes empty
- How to get the number of pages when paginating comments?
- WordPress actions for plugin admin UI page
- wp_insert_user keeps echoing values
- Getting posts by taxonomy
- Pause plugin option page until all data manipulation is complete
- can members have multiple registration using the same password?
- Exclude Woocommerce Product Category From Sitemap
- WordPress (pagenow link) in ajaxurl change after i change plugin language
- How to show only the last two categories in a menu?
- Get API auth_token token to renew weekly
- howTo let wordpress endpoint return html-page
- User meta query using Wildcard
- use a (Polymer) web component within a plugin (or theme)?
- how to add security questions on wp-registration page and validate it
- wp_ajax add_action fuction won’t fire on custom jQuery action
- Customize WordPress Admin Menu
- Dedicated server and WPDB Class : huge slow-down of the website
- How can I see a varibles value when my plugin runs?
- Add Button to TinyMCE Custom Menu
- How should I use wpdb class to submit a form in admin dashboard?
- Rewriting URLs with a query string
- Forcing ALL plugin Admin menus into a separate menu
- WordPress plugin: admin-ajax.php not passing data to custom function
- Create pages for authors
- How do I create Widget within plugin that uses its own class?
- Looking for Hook that is fired after a plugin or wp upgrade is installed/updated
- How to design WooCommerce-like admin tabs for plugin settings page?
- Woocommerce: block user removing cart item
- How can I dynamically change title and description in WordPress?
- WordPress pre-build slider
- Anyway to prevent admin from seeing other admin’s product?
- Build a dynamic block using the default attributes
- How to display .ptm file in my WP site without JAVA
- Programmatically creating posts based on external JSON feed (asynchronously)
- Bulk post approval and publishing doesn’t work
- Show Admin Menu
- How to replace content of a block in and re-render on change?
- extending a core block doesn’t work inside the editor
- register_activation_hook doesn’t execute without add_action(‘init’,’some-function’)
- Getting similar posts by custom field value
- Does WP REST API cache internally executed (rest_do_request) requests?
- Trouble Importing whatsapp-web.js in a WordPress Plugin Development
- ‘useSate’ error when using React on the frontend in custom block plugin
- Display months on a drop down calendar as TEXT instead of Numbers
- Insert text programmatically in WordPress Gutenberg Editor
- audio tags no longer working
- How can I get Intellisense working in Visual Studio Code while editing remote PHP plugin code on a WordPress site via FTP?
- How to be GDPR compliant by loading plugins?
- Custom Plugin Breaks Other Plugin Functions
- Add File field in WooCommerce Box office plugin
- Overwrite WordPress Plugin Class Function
- Woocommerce Payment Plugin with Mycred being the payment processor
- How to modify the uploads directory for wp.media.frame assigning an subfolder name
- Gutenberg InnerBlocks noallowedblocks on parent but allowedblock on Child
- WordPress ajax form submit post url return 404
- WordPress Media Uploader not displaying image that has just been uploaded
- Woocommerce Reviews tab not showing on single product page
- Rebuild Core Block as Separate Plugin
- Using @wordpress/scripts 28.x with WordPress
- User set default settings for a Block in Site Editor
- Can’t get hexcode as color settings on save.js file, although I can on edit.js
- Load specific CSS file
- $_GET[”] variable with nonce verification
- WordPress plugin update View version remove Update now
- How to assign to each output values from foreach loop to a meta_key?
- Woocommerce : Update attribute options from existing attribute [closed]