Questions tagged [fetch]

DO NOT USE. For questions about the JavaScript Fetch API, use the [fetch-api] tag instead. For the git subcommand, use [git-fetch]. This tag is ambiguous.

fetch is used in many contexts, include source control, database querying, and cache control.

References

11193 questions
45
votes
4 answers

Linq for NHibernate and fetch mode of eager loading

Is there a way to set the fetchmode to eager for more than one object using linq for nhibernate. There seems to be an expand method which only allows me to set one object. However I need to set it for more than one object. Is this possible? Thanks
NabilS
  • 1,421
  • 1
  • 19
  • 31
44
votes
2 answers

Handle a 500 response with the fetch api

We have the following call to fetch. this.http.fetch('flasher', { method: 'post', body: jsonPayload }) .then(response => response.json()) .then(data => console.log(data)); This works when we receive a 200 response but logs nothing to the…
Shaun Luttin
  • 133,272
  • 81
  • 405
  • 467
41
votes
5 answers

Fetch API requesting multiple get requests

I would like to know how to fetch multiple GET URLs at once and then put the fetched JSON data into my React DOM element. Here is my code: fetch("http://localhost:3000/items/get") .then(function(response){ response.json().then( …
Jaypizzle
  • 477
  • 1
  • 5
  • 7
40
votes
16 answers

Failed to fetch URL https://dl-ssl.google.com/android/repository/addons_list-1.xml, reason: Connection to https://dl-ssl.google.com refused

Using Android SDK Manager when I try to update it just gives the following messages about not being able to connect. I've tried disabled firewall and anti malware. I also tried to run as admin and move to c:\android. I'm running windows 7 64bit. …
John Lee Hedge
  • 481
  • 1
  • 6
  • 9
39
votes
2 answers

difference between FetchMode and FetchType

what is the difference in specifying lazy = "true" and using fetch = "select" or "join" ? which one is preferred over the other ? regards jayendra
jayendra bhatt
  • 1,337
  • 2
  • 19
  • 41
37
votes
8 answers

Fetch post with body data not working params empty

I am trying to rewrite my ajax call to fetch: Ajax: $.post({ context: this, url: "/api/v1/users", data: { user: { email: email, password: password } } }).done((user) => { …
Petr
  • 1,853
  • 2
  • 25
  • 49
34
votes
1 answer

Parse data from JSON in ReactJS

I have data like this: { "movies": [ { "abridged_cast": [ { "characters": [ "Dominic Toretto" ], "id": "162652472", "name": "Vin Diesel" }, { …
necroface
  • 3,365
  • 10
  • 46
  • 70
34
votes
3 answers

React Native - Fetch call cached

I am building an app in react native which makes fetch calls that rely on the most up to date information from the server. I have noticed that it seems to cache the response and if i run that fetch call again it returns the cached response rather…
Andrew Ives
  • 467
  • 2
  • 6
  • 12
32
votes
7 answers

JPA 2 Criteria Fetch Path Navigation

With JPA 2 Criteria Join method I can do the following: //Join Example (default inner join) int age = 25; CriteriaBuilder cb = entityManager.getCriteriaBuilder(); CriteriaQuery c = cb.createQuery(Team.class); Root t =…
Alfredo Osorio
  • 11,297
  • 12
  • 56
  • 84
31
votes
3 answers

Simple fetch mock using Typescript and Jest

What would be my absolute easiest way of mocking fetch using Typescript? I would just like to do something simple like below. But Typescript tells me that I'm not matching the definition for the full fetch object. Type 'Mock
Riri
  • 11,501
  • 14
  • 63
  • 88
31
votes
8 answers

Is there a way to fetch associative array grouped by the values of a specified column with PDO?

For example, let's use some simple data set +---------+------+------+------------+ | name | age | sex | position | +---------+------+------+------------+ | Antony | 34 | M | programmer | | Sally | 30 | F | manager | | Matthew…
HongKilDong
  • 1,276
  • 3
  • 16
  • 23
29
votes
3 answers

How can I start another request after AbortController.abort()?

I've read about cancelling fetch requests by using AbortController.abort(). Is there a way to start a request again without aborting it after calling this command? For example, in this demo from MDN, once Cancel download has been clicked, clicking…
jenwoodson
  • 373
  • 4
  • 9
29
votes
4 answers

Making REST calls from a react component

I am trying to make REST call from a react component and render the returned JSON data into the DOM Here is my component import React from 'react'; export default class ItemLister extends React.Component { constructor() { super(); …
user_mda
  • 18,148
  • 27
  • 82
  • 145
28
votes
7 answers

com.facebook.react.bridge.readablenativemap cannot be cast to java.lang.string

My code: const file = { uri: this.state.imageSource, name: this.state.imageName, type: 'image/jpg', }; const data = new FormData(); data.append('file', file); fetch(config.server + '/upload', { method: 'POST', body: data, }) …
kutirie
  • 583
  • 1
  • 4
  • 9
28
votes
2 answers

Why does Hibernate execute multiple SELECT queries instead of one when using @Fetch(FetchMode.JOIN)

I've got the following query which I expect to run in a single select request: @NamedQuery(name=Game.GET_GAME_BY_ID1, query = "SELECT g FROM Game g " + "JOIN FETCH g.team1 t1 " + "JOIN…
maximus
  • 4,201
  • 15
  • 64
  • 117