Then it's probably a problem with the JS - sending it as text/plain is just wrong.