How to Send Data with POST Requests in Ionic 2

How to Send Data with POST Requests in Ionic 2

Follow Josh Morony on

Learn Ionic with Josh ☕

Hey, I hope you enjoy the article.

If you want a weekly update with my newest content, access to the blog's bonus content, or you want to sign up for one of my free beginner or advanced email courses just enter your details here or in the form below.

In the past, we have covered how to make a simple GET request to load data from a server, and for the most part, making a POST request is pretty much the same.

There are a few key differences, though, including the fact that a POST request also includes a body, and there’s also a feature that is built into observables that may trip you up when attempting to make a POST request. In this video tutorial, we walk through a basic example of sending a POST request to a server in Ionic 2.

Here’s the video:

Video Notes

  • POST requests are similar to GET requests, but a POST request also contains a body with data
  • You can import Headers and add them to your POST requests to specify things like Content-Type
  • Observables are “lazy”, so if you don’t subscribe to your POST requests they will never be executed

If you enjoyed this article, feel free to share it with your friends ☝

Check out my latest videos: