I am trying to upload the image using below URI API call with
multipart/form-data as i have almost 1 to 6 image to be uploaded at a time.
Task work as expected but the issue is upload image are all scattered. I tried to upload using the curl and with GUI work perfectly.
Can anyone help.
- name: multipart api call
uri:
url: "IP/api/xxxx/images"
method: POST
headers:
Content-Type: "multipart/form-data"
Authorization: "Bearer {{ access_token }}"
validate_certs: <true/false>
body_format: form-multipart
body:
image1:
content: "{{ lookup('file', 'path_to_image.jpg')}}"
filename: "path_to_image.jpg"
type: image/jpg
register: register_uri_val
delegate_to: localhost