How can I send POST request data from Android to node server?

Asked 2 years ago, Updated 2 years ago, 35 views

If I transfer the data from Android to node server, I want to send fcm message with the data I received from the server using timer.

<a> http.createServer((req, res) => {</a>
<a>  res.write('Hello Node!');</br>
  setTimeout(sendFCM, 10000);</br>
  res.end('hello world!\n');</br>
}).listen(4999, () => {</br>
  console.log ('Waiting for fcm on port 4999);</br>
})</br>

When you click the IP and port on the webpage, the function functions normally. When a POST request is received from the client to the port, I would like to interpret the ('content-type', 'application/json; utf=8') type on the web server and deliver the necessary parameters to the FCM. (Actually, I don't know much about grammar) I'd appreciate it if you could write or reply to me!

android node.js

2022-09-21 13:53

1 Answers

If you're curious about FCM, just start with FCM Android Implementation Guide. I read it roughly, and the key issue you're talking about is, "How do I start sending messages from Android devices?"But... I think you can implement one HTTP protocol so that this looks similar POST request .

+ Interfere: You said you don't know much about grammar, but no matter how well you know it, it will be difficult to reach FCM without the basic concept of "real-time message pushing." We recommend that you understand the operating principles and implementation procedures first.


2022-09-21 13:53

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.