0

I am making an ajax "GET" request to get google wikipedia data in my application. I want to get the progress in numbers to feed it to my loading progress bar. Is there any way to do this for "GET" request? All the solutions available are either for upload or "POST".

THis is my request code

let params = { 'query': this.state.info_search_text, 'limit': 10, 'indent': false, 'types': 'Person', 'prefix': true, 'key': 'AIzaSyDuttGdbTLwBlVWunqGPdgUrb1c2gXwPYk' }; $.getJSON(service_url + '?callback=?', params, (response) => { this.setState({ infoSearchResults: response.itemListElement, showLoadingBar: false }, () => { console.log(this.state.showLoadingBar) }); }); 
5
  • I can't flag this as a duplicate, but here is the link to an answer that already has it done for you: https://stackoverflow.com/questions/19126994/what-is-the-cleanest-way-to-get-the-progress-of-jquery-ajax-request Commented Mar 12, 2018 at 13:36
  • "$.getJSON(service_url + '?callback=?'" — It isn't possible with JSONP. You need to use XHR or Fetch. Commented Mar 12, 2018 at 13:39
  • @Quentin true....i did not know this. But how can this work without using websockets? Commented Mar 12, 2018 at 13:39
  • 1
    @messerbill — See the duplicate question Commented Mar 12, 2018 at 13:40
  • @Quentin this is quite awesome. - so the client will request and once the server started to respond the progress handler waits for new incoming "data parts"? Commented Mar 12, 2018 at 13:42

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.