If I want to download a file, what should I do in the then block below?  function downloadFile(token, fileId) {   let url = `https://www.googleapis.com/drive/v2/files/${fileId}?alt=media`;   return fetch(url, {     method: 'GET',     header...
thanks for stopping by.  I want to send a new FormData() as the body of a POST request using the fetch api  the operation looks something like this    var formData = new FormData() formData.append('myfile', file, 'someFileName.csv')...
I'm basically just trying to verify if a resource is reachable from the executing client. I can not use XHR, because the target resource doesn't allow that.  I'm pretty new to JS and am currently working with this ( executable here ):...
I hope I could find some help to the issue.  I'm using React Native and try to get some data from an API called Feiertage-API (https://feiertage-api.de/), that basically returns (should return) the official holidays in Germany.  Trying to use fet...
Update  TL;DR: This is potentially a bug in Safari and/or Webkit.  Longer TL;DR: In Safari, after the Fetch API is used to make a GET request, Safari will automatically (and unintentionally) re-run the the request when the page is reloaded even if th...
I got the response from server like this:  Request URL:http://api.bfexchange.net/wallet/balance Request Method:GET Status Code:504 Gateway Time-out Remote Address:52.78.140.154:80 Referrer Policy:no-referrer-when-downgrade   But printing err in catch...
Ok, I know it's a bad idea and it shouldn't be done but for the sake of this question please assume there's no other way - I am given API endpoint that requires GET request with empty object as a body.  Is there a way to do async request...
I'm using fetch to make API calls and everything works but in this particular instance I'm running into an issue because the API simply returns a string -- not an object.  Typically, the API returns an object and I can parse the JSON object a...
I checked out a few resources but don't really get the fetch method.  What is the point in having 2 then-s? What is the first and the second then good for? Why is a return in the first one?   fetch('http://some-site.com/cors-enabled/some.json...

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.