Hey @Reshma, You can use the URI Module for this purpose. This module interacts with http and https servers supports many authentication mechanism.
Try something like this:
tasks:
- name: post to consul
uri:
url: http://marathon.service.consul:8080/v2/apps/
method: POST
body: "{{ lookup('file','mesos-consul.json') }}"
body_format: json
headers:
Content-Type: "application/json"