From the course: JavaScript: Web Form Programming

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Sending data with FormData

Sending data with FormData

From the course: JavaScript: Web Form Programming

Start my 1-month free trial

Sending data with FormData

- [Instructor] Previously, we saw how to use the form data object to create a key value data structure to hold the content of a form and prepare it to be sent to a server. In this example, we're going to see how to do exactly that. Now, to keep this example simple, I'm going to use an online testing service called HTTP bin to test my form submission. So let's jump over to the browser really quick. And that is this site here, it's called httpbin.org. And you can see that there are a variety of endpoints that you can use to test all kinds of rest based operations. So for this example, we're going to specifically use the post endpoint in the HTTP methods category. And this endpoint will accept the data that we post using our form, and then return the result as a JSON data structure that we can inspect back in our client side code. So I'll leave it to you to play around with HTTP bin. But in the meantime, let's go back to our code.…

Contents