-1

i want to send data like this

{"update_id":121631120,"message":{"message_id":1,"from":{"id":"TGID","is_bot":false,"first_name":"ELBARON @LxEEE","username":"USERNAME","language_code":"en"},"chat":{"id":"TGID","first_name":"ELBARON @LxEEE","username":"USERNAME","type":"private"},"date":1594553383,"text":"TEXT"}}

to this url

http://hfkm.ga/market/usersbothf/491856302/suc.php

using javascript, but i can't find somthing help.

sorax
  • 63
  • 1
  • 8

1 Answers1

1

Axios can be used to send HTTP requests like the fetch api. For installing axios use: npm install axios (assuming nodejs is installed)

OR

you can use the CDN: <script src="https://unpkg.com/axios/dist/axios.min.js"></script> (paste this in your index.html)

axios({
    method: 'post',
    url: '/login',
    data: {
        update_id: 121631120,
        message: {
            message_id: 1,
            from: {like so...}
        }
    }
})
.then((response) => {
        console.log(response);
    }, (error) => {
        console.log(error);
    }

For more details : https://blog.logrocket.com/how-to-make-http-requests-like-a-pro-with-axios/

Adwaith
  • 1,099
  • 1
  • 9
  • 6
  • i don't want to use npm just i need to do what this site do https://reqbin.com/ using js – sorax Jul 12 '20 at 19:42