body: JSON.stringify(data),
}).then(res => res.json())
.then(data => {
// do something with data
then(res => res.json
// do something with data
postData(data) {
fetch('api/somePath', {
method: 'post',
headers: {
'Accept': 'application/json, text/plain, */*',
'Content-Type': 'application/json',
},
body: JSON.stringify(data),
}).then(res => res.json())
.then(data => {
// do something with data
});
}
'api/somePath'
в fetch('api/somePath'
def ad_size
@ad_size ||= FooAbc::FooXyz.get("act_#{env(:shirt_size_id))
end
def ad_size
@ad_size ||= FooAbc::FooXyz.get("act_#{env(:shirt_size_id))
end
require 'rest-client'
RestClient.post(url, payload, headers={})