R
R
romasovest2018-03-06 19:57:06
JavaScript
romasovest, 2018-03-06 19:57:06

When sending an ajax POST request in the debugger, the request is displayed as GET? How to send ajax POST request?

The code:

$.ajax({
  url: "https://jsonplaceholder.typicode.com/users",
  type: "post",
  data: {id:1},
  dataType: "jsonp",
  success: function(msg) {
    console.log(msg);
  }
});


Network gives this:
Request URL:https://jsonplaceholder.typicode.com/users?callback=jQuery321049373934725378943_1520358665074&id=1&_=1520358665075
Request Method:GET
Status Code:200 
Remote Address:104.31.87.157:443
Referrer Policy:no-referrer-when-downgrade


How to make an ajax POST request or how to find out by what method my request was sent?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
RidgeA, 2018-03-06
@RidgeA

Instead of -
method: "post",

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question