Questions tagged [aurelia-fetch-client]

41 questions
0
votes
2 answers

CORS error with Aurelia calling .NET core API 2.0

I am getting a CORS error and I don't know how to fix it. I have an Aurelia app, calling a .NET core 2.0 API using aurelia-fetch-client. I am getting the following error: Failed to load http://localhost:58289/api/info: Response to preflight request…
0
votes
1 answer

Why is aurelia's fetch client catch error typed as any rather than Response

I'm cutting my teeth on Aurelia, aurelia-fetch client and Typescript. I notice in typescript when I set up the catch function .catch(error => //do something error) error is defined by typescript as any but when I inspect it in the debugger I can…
OrdinaryOrange
  • 2,420
  • 1
  • 16
  • 25
0
votes
2 answers

Aurelia - Setting headers in Aurelia Fetch Client

I'm using aurelia-http-client and struggling to both use interceptors and set headers for my requests. What I need to achieve is; Each Interceptor (request, request error, response, and response error) emits an event using aurelia-event-aggregator…
Tom
  • 4,257
  • 6
  • 33
  • 49
0
votes
1 answer

Aurelia http-client/http-fetch not sending headers

Tried multiple approaches to send custom-headers via Aurelia-http-client and Aurelia-Fetch-client to pass Headers in the get/post requests that I am making, but in the actual request, the headers are not being passed approach 1 var client = new…
0
votes
3 answers

Add dependencies to Aurelia project

I set up an Aurelia project using the minimal project given here. Then I added the fetch-client using npm install aurelia-fetch-client --save command. It updated package.json to contain following: "dependencies": { "aurelia-fetch-client":…
software_writer
  • 3,941
  • 9
  • 38
  • 64
0
votes
0 answers

Why my headers are being lowercased?

let headers = new Headers(); headers.append('Accept', '*/*'); headers.append('Content-Type', 'multipart/form-data'); let payload = await this.http.fetch(path, { method: 'post', body: item, headers: headers }).then(response =>…
0
votes
1 answer

TypeError when using aurelia-fetch-client

I am using the aurelia-fetch-client version 1.0.1. I execute the fetch within a service class that I have created, and I get an error stating: TypeError: Cannot read property 'isProtoTypeOf' of undefined at eval …
Catchops
  • 193
  • 3
  • 12
0
votes
2 answers

Modify all requests adding a new parameter

I'm trying to find an elegant way to add a parameter on every fetch done by my app. Is there any configuration that allows me to modify the body appending a new property? I looked at the documentation and aurelia-fetch-client implementation on…
Smaniotto
  • 404
  • 4
  • 16
0
votes
0 answers

aurelia-fetch-client and configuration

I use the fetch client of Aurelia to fetch data from a REST-service. My problem is that, even though the HttpClient is only imported once in the AuthService Class, I have to pass it the configuration object before every single request, or it falls…
Stian Bakken
  • 673
  • 1
  • 5
  • 15
0
votes
2 answers

Aurelia typescript load json service

I am trying to create a class that will have two functions: 1) Load items from a json stored in my local server and return that variable with all the items. 2) Return a single item by id. The problem is I want to use these two methods from…
fpluis
  • 189
  • 1
  • 13
-1
votes
1 answer

Next step after OPTIONS/200OK

An Aurelia SPA uses fetch against a different origin server. A preflight OPTIONS request is sent and because the server is configured to respond, the response is 200 OK. But that's all that happens. What must I add to make the rest of it…
Peter Wone
  • 17,965
  • 12
  • 82
  • 134
1 2
3