On the use of Axios

Today, I submitted the JS using the AJAX that Axios writes and registers. It can send requests normally, but I find that the backend can not accept the username and password information from the frontend at all. How should I fix this BUG? Thank you.
part of the JS code (jQuery):

var captcha_res_ticket = $.cookie("captcha.res.ticket");
var captcha_res_randstr = $.cookie("captcha.res.randstr");
var username = $("-sharpinputUsername").val();
var email = $("-sharpinputEmail").val();
var password = $("-sharpinputPassword").val();
var repassword = $("-sharpinputRepassword").val();
var agree_user_agreement = $("-sharpagree_user_agreement").is(":checked");
var participate_in_the_user_experience_program = $("-sharpparticipate_in_the_user_experience_program").is(":checked");

Axios partial code:

axios({
            url: "/user/user_registration/php/registration.php",
            method: "post",
            timeout: 3000,
            data: {
                captcha_res_ticket: captcha_res_ticket,
                captcha_res_randstr: captcha_res_randstr,
                username: username,
                email: email,
                password: password
            }
        })

Captcha comes from my CAPTCHA API.

Jun.08,2022

The

superglobal variable $_ POST cannot accept the request body of content-type: application/json.

< H2 > solution < / H2 >
<?php
echo file_get_contents('php://input');

Axios partial code (JS):

        const params = new URLSearchParams();
        params.append('captcha_res_ticket', captcha_res_ticket);
        params.append('captcha_res_randstr', captcha_res_randstr);
        params.append('username', username);
        params.append('password', password);
        axios({
            url: '/user/user_login/php/login.php',
            method: 'post',
            timeout: 1000,
            data: params
        })
Menu