I am trying to trigger a pipeline through a curl request. The request contains json body. How to read that in jenkinsfile.
if you want to pass data to your job you need to define parameters on the job.
When you trigger the job via curl you can pass the parameter values
see Remote Access API
Thanks for the response. I have a case where a pipeline must be triggered by bitbucket webhook. Bitbucket webhook sends event data in a JSON payload. I tried using their URL variables but have not figured out how to use them, plus they are limited. JSON data is more detailed, and getting that data in jenkinsfile would be more useful