src/utils.js
function postJson({ url, payload, contentType, useBearer }) {
  return ajax({
    url,
    method: 'post',
    body: JSON.stringify( payload || {} ),
    contentType,
    useBearer
  })
}
function postJson({ url, payload, contentType, useBearer }) {
  return ajax({
    url,
    method: 'post',
    body: JSON.stringify( payload || {} ),
    contentType,
    useBearer
  })
}
function postJson ( { url , payload , contentType , useBearer } ) { return ajax ( { url , method : 'post' , body : JSON . stringify ( payload || { } ) , contentType , useBearer } ) }
Post JSON data.

@param {string} url - The URL to make the request to.
@param {object} payload - Data to be sent with the request.
@param {string} contentType - The content type of the request. Defaults to "application/json".
@param {boolean} useBearer - Flag indicating whether to include bearer authorization.
Post JSON data .