G
G
gloribus2016-04-06 19:50:12
JavaScript
gloribus, 2016-04-06 19:50:12

How to send a Post request with JSON?

How to send a JSON request via JQUERY POST? And get an answer?

{
"name1": "data1",
"nameArray": [array],
"name2": "data2"
}
How can I send this json? On ip:5000/buy
Simply sends via POSTMAN, and so is not present.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Burov, 2016-04-06
@gloribus

api.jquery.com/jquery.post

$.ajax({
  type: "POST",
  url: url,
  data: {key: 'value'},
  dataType: 'json'
});

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question