In the preceding recipes, we looked at how to get data from a remote web server. You may also wish to send data collected from your application to a web server for storage, for instance. Sending data to web servers is the other half of the rich interactions that are supported between JavaFX applications and remote servers. In this recipe, we explore how to post data to a web server.
You should have an understanding of the basic mechanics behind the Web and how HttpRequest
interacts with the server to handle the request/response life cycle. You should also review materials from Chapter 4, Components and Skinning, for information on building data forms. For this recipe, let's assume that we have a web server running an application that can accept the submission of an employee form at the address http://localhost:8080/webapp/employee/save
. In this section, we will see how to use JavaFX to submit data to a web server using the POST...