Skip to content

How access portions of the request. #1250

Answered by Umang01-hash
marvfinsy asked this question in Q&A
Discussion options

You must be logged in to vote

@devorbitus Here is my attempt to provide you with some implementation regarding how can we achieve our use-case using a middleware:

package main

import (
	"bytes"
	"context"
	"fmt"
	"io"
	"net/http"

	"gofr.dev/pkg/gofr"
	gofrHTTP "gofr.dev/pkg/gofr/http"
)

func main() {
	// Create a new application
	a := gofr.New()

	// Register the middleware for validating Zoom webhooks
	a.UseMiddleware(zoomWebhookValidationMiddleware("webhook-secret"))

	// Register the POST handler for the Zoom webhook
	a.POST("/zoom-webhook", handler)

	// Run the application
	a.Run()
}

// handler processes the validated webhook request
func handler(c *gofr.Context) (interface{}, error) {
	// Check if the reques…

Replies: 12 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by vikash
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #1209 on November 28, 2024 03:09.