-1

I am new, i'm developing an application with the technologies shown below. Now, i want to retrieve an highly sensitive data from a server; Is there a way to use a HTTP POST request to do it in angular typescript? Thank you.

Technologies that I currently use:

  • Ionic 4.10.2
  • Angular 6
  • 8.1.2 (cordova-lib@8.1.1)
  • TypeScript
  • Visual Studio Code
  • Possible duplicate of [How to process POST data in Node.js?](https://stackoverflow.com/questions/4295782/how-to-process-post-data-in-node-js) – Spinkoo Feb 20 '19 at 09:56

1 Answers1

0

To make POST requests with Ionic, you can use the Angular's HttpClient or HTTP plugin: HTTP. If you want to use the HTTP plugin, do not forget to read the README in the plugin's GitHub repo to know how to use it.

JoH
  • 514
  • 1
  • 6
  • 16
  • I am using HttpClient (that i imported in @NgModule), it's the same thing? – Giuseppe Damis Feb 20 '19 at 09:57
  • The HttpClient is provided by Angular and the HTTP plugin is provided by a contributor, they do the same thing, so you can use the HttpClient to make your HTTP requests. – JoH Feb 20 '19 at 10:03
  • Ok, thank you! What can i show my results on html page? – Giuseppe Damis Feb 20 '19 at 11:04
  • The HttpClient provide a `post()` method which needs, at least, two parameters, the URL and the data. This method returns an Observable, you have to subscribe to it to get your results. You put your results into a variable that you show in your page. If your results are an array, you have to iterate through it with `*ngFor` directive, if it is just text, you have to use interpolation. – JoH Feb 20 '19 at 12:41