DEV Community

Nagarajan R
Nagarajan R

Posted on

1

Answer: Post request via Chai

The way you have written, I assume that you used chai-http package. The .field() function does not work in chai-http. Another user pointed it out here and opened an issue on github.

Here is how you could have written:

.set('content-type', 'application/x-www-form-urlencoded')
.send({myparam: 'test'})

Here is the full code…

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more