From the course: AWS API Gateway with HTTP, Lambda, DynamoDB, and iOS
Unlock the full course today
Join today to access over 24,500 courses taught by industry experts.
POST method and model - Amazon Web Services (AWS) Tutorial
From the course: AWS API Gateway with HTTP, Lambda, DynamoDB, and iOS
POST method and model
- [Instructor] Okay, so let's do one more method on our API. We're going to do the POST method, and this method allows us to create new items on the server. So we need to add a POST method on a resource, ideally one that doesn't have an ID, because we're trying to create it, we don't have an ID yet. And then we also need to handle the method request and integration request, kind of like we did with the response where we declare what kind of data we expect to be sent up from the consumer, as well as how to map that to what the server expects. And then we can do the same thing as we've done before with the response. So here in the API, I want to add a post. I typically do it on the resource with just the name because we don't have an ID. You could certainly do it with an ID on the end, and you do a post and that is going to use that ID. But that's not very common, because you don't know if that ID is used yet. And if you want to replace that, that's a put. And if you want to update it…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.