Function post_with_headers_get_json

  • Takes a url, and data in form of URLSearchParams, and header, then performs http POST request and converts result to json then returns the json.

    Parameters

    • url: string
    • params: URLSearchParams
    • headers: any

    Returns Promise<any>

    Heres a post example that returns a json object.

    const params = new URLSearchParams();
    params.append('a', 1);
    let headers = {} ;
    let url = "" ;
    let result = await post_with_headers_get_json(url, params, headers) ;