2

I am writing a script that pulls JSON data from xyz.site and puts into site.xyz Here I am able to pull data from xyz.site through jQuery's $.getJSON but I am facing a issue while making a put/post request.

Can anyone please help me on this?

1 Answer 1

13

You should use jQuery ajax method and specify type option as PUT or POST

$.ajax({
    url: 'url', // your api url
    // jQuery < 1.9.0 -> use type
    // jQuery >= 1.9.0 -> use method
    method: 'PUT', // method is any HTTP method
    data: {}, // data as js object
    success: function() {}
});
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.