I am building an API and I have a method that will accept a POST request with a couple of parameters.
One of the parameters will be HTML code. A user can pass in a whole HTML page, how should I accept this?
Is it ok to ask the user to base64_encode it? Or is it there a better way?
I am worried about parsing invalid characters and different character encodings etc.
You really want the user to encode their HTML with
base64? 🙂That would be not viable
Just put a and accept the HTML. Be careful with XSS and other malicious staff