Hi @Abha Sharma ,
Per my research, with SharePoint Online you have no direct access to the web.config files, IIS, or to deploy custom code solutions. So, you won't be able to add the Http Handler in any of those fashions. I feel regretful to inform you that it turns out to be a by-design one.
And I noticed that some end users have also proposed the same request, it is highly recommended that you can vote this ticket. Many features of our current products are designed and upgraded based on customers’ feedback. With requirements like this increase, the problem may well be released in the future. Thanks for your understanding.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.