File upload with jwt token angular

Viewed 558

I am trying to upoload a file to my laravel backend using form data and I need to send the jwt bearer token. What headers should I use.

1 Answers

You should send Authorization header with your request . please try like this.

const headers = new Headers({
      'Authorization': `Bearer ${token}`
})

return this.http.post(apiUrl,formData , { headers: headers })
Related