Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

boyjarv's avatar

Angular POST to API

Need a bit of help here posting to my API?!

ok so I have the right URL I have the right object movie that I want to post I have the right token it works in POSTMAN

addMovieToFavourites(movie) {
    console.log('movie: ', movie);
    return this.http.post(this.favapi, movie, {
      headers: {
        Authorization: 'Bearer ' + this.currentUser.token,
      },
    });
  }

I'm not getting any errors, nothing going in my database my GET method works

0 likes
2 replies
neilstee's avatar

@boyjarv, can you log this.favapi and this.currentUser.token as well?

What are the settings you use in Postman?

Feuille's avatar

Please post your Route declaration, AuthServiceProvider, RouteServiceProvider, and the Http\Kernel

Please or to participate in this conversation.