Hi @Hrithik Greetings! Welcome to Microsoft Q&A forum. Thank you for posting this question here.
the request keeps sending continuously without completion
I understand that you have set the Content-Type of the function to text/event-stream
However, it is possible that the Azure function is not receiving any events from the calling end point in the expected format. Hence there is output being returned from Azure functions back to the calling end point, which is Postman in this case. Test the application locally and see if the function gets when you call the local end point URL.
Furthermore, Azure functions have a limited support to HTTP streams or SSE events. The HTTP trigger function is designed to operate only for a max period of 230 seconds once triggered and the connection gets terminated. When a client application is calling a http triggered function app and the function app is taking more than 4 minutes to respond, it times out. It is not recommended to use HTTP Tigger to process event streams or any long running operations. Please refer the Function App timeout settings for reference.
Azure functions support for SSE
I am not sure if this feature is supported in Go yet. There is a preview feature available in Azure functions that use Python to Support HTTP streams. This feature uses the FastAPI request and response methods to accept and return the SSE events. Please also refer this discussion on HTTP streaming response support for Azure functions for additional information on this. Consider using the Python code sample instead of Go and see if you get the expected events returned from the Azure function.
Hope this helps!