HTTP API Gateway part three - Redirect users using AWS Lambda integration

Поделиться
HTML-код
  • Опубликовано: 5 авг 2024

Комментарии • 6

  • @notEpicc
    @notEpicc 4 месяца назад

    Amazing video! I'm doing a university assignment where i have to create a URL-shortener using AWS, and after watching hours of content about redirects and APIs and not understanding anything, it's amazing how simple and well-paced this video is!

    • @EndreSynnes
      @EndreSynnes  4 месяца назад

      Thank you so much!😄
      That sounds like an interesting assignment, especially that you are using AWS to do that😄 Thank you, it's great to see that people find my videos helpful!

  • @deemon710
    @deemon710 3 месяца назад

    It was surprising how simple the code is to redirect a user. I wonder is it possible to redirect a POST request, too?

    • @EndreSynnes
      @EndreSynnes  3 месяца назад

      Hi 😄
      Yes It can be quite simple to do that for HTTP GET requests 🙌 Depending on your requirements, doing redirects for POST requests may not be as simple. Do you want your users to be redirected as a respons for your POST request (this can be achieved quite easily)? Or do you want the POST request itself to be redirected to another API?

    • @deemon710
      @deemon710 3 месяца назад

      @@EndreSynnes I wanted to modify the parameters they sent in their POST request and return a redirect with the updated params so they would make an updated POST request. In the end, I just did it for them and returned the response. But I'm still curious if it's possible to say 'naw, send your POST request here instead of to me. '

    • @EndreSynnes
      @EndreSynnes  3 месяца назад +1

      @@deemon710 I see, my initial thought is that you have to handle this on the client/front-end🤔 I’m not sure a web browser is “smart enough” to perform the same POST request to another API given a 3xx response by itself 😅
      Alternatively if you control both domains for the two applications, I guess you could just point the old domain to the new application as well, using for example Route53? Then again you wouldn’t be able to manipulate the parameters before hitting the new API.
      Unless you intend use a lambda function (or similar) to forward the http request to the new API🙈