Change `content-type` header for POST requests from "text/plain;charset=UTF-8" to `application/json`
Describe the bug
If the request content type header is not set to application/json , common API frameworks like express with body-parser cannot parse it
To Reproduce Steps to reproduce the behavior:
- Set up
CopilotTextArea - Send a request to an
expressserver withbody-parsermiddleware enabled [ really common for JSON ] - Try and parse the body with
req.bod req.bodyis empty
Expected behavior I expect
Screenshots If applicable, add screenshots to help explain your problem.
** Browser (please complete the following information):**
- Universal
Additional context
- Sending JSON as
jsonis a standard convention, this could break not just Express but most other frameworks.
@ataibarkai I would like to work on this issue.
Great @iamtouha , let me know if you need any support
Certainly! Could you please specify which files I should be looking at to apply the changes.
Is this bug done?
@ataibarkai Created a PR regarding this issue. https://github.com/CopilotKit/CopilotKit/pull/149