The Ultimate Guide to HTTP Method Spoofing HTML Forms with AdonisJS 5

Опубликовано: 16 Октябрь 2024
на канале: Adocasts
679
12

In this lesson, we'll learn how we can utilize Http Method Spoofing to send PUT, PATCH, and DELETE requests using native HTML forms. We'll then create utility functions to make the implementation cleaner.

👍 If You Enjoy This Video, Consider Hitting The Like Button!

🥁 Subscribe To Stay Notified For New Videos: https://www.youtube.com/adocasts?sub_...

📕 Read & View on Adocasts: https://adocasts.com/lessons/http-met...

🧾 Find The Code For This Lesson Here: https://github.com/adocasts/http-meth...

Native HTML only supports sending GET and POST requests with forms to the server. However, utilizing Method Spoofing with AdonisJS we can spoof POST requests to the remainder of the Http Methods, ie: PUT, PATCH, and DELETE so that AdonisJS utilizes the spoofed method to match the desired route.

In essence, if we wanted to target a PUT: /posts route, we can do so using Method Spoofing and a native HTML form.

🎬 Check Out More Videos Here:

AdonisJS & InertiaJS 1.0:    • Adonis & Inertia - EP1.0: How to add ...  
AdonisJS Auth in 15 Minutes:    • AdonisJS Authentication in 15 Minutes  
AdonisJS Quick Tips:    • AdonisJS Quick Tip  
Let's Learn AdonisJS 5:    • Let's Learn Adonis 5  

-------------------------Socials--------------------------

🕸️Website: https://adocasts.com

🐦Twitter:   / adocasts  

👍 GitHub: https://github.com/adocasts