문제

How to write the underlying code given in the Moxtra API in jQuery or JavaScript

POST /v1/UiaduESWsbzFoK9TOldC6zF/binders

{

    "name": "My First Binder"
}


{
    "code": "RESPONSE_SUCCESS",
    "data": {
        "id": "B7U3ze39oO08PYO70973lX6",
        "name": "My First Binder",
        "revision": 3,
        "created_time": 1342813061602,
        "updated_time": 1342813061602
    }
}
도움이 되었습니까?

해결책

Assuming you want to POST the first object and receive the second object as a successful response, here's how you'd do it with jQuery's shorthand AJAX POST function:

var data = {"name": "My First Binder"};

$.post("/v1/UiaduESWsbzFoK9TOldC6zF/binders", data, function(response) {
  // Response object contains your response from the server
  console.log(response);
});
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top