title: magento 2 rest api add to cart with custom options type file jpg
body: <p>I am trying using rest API to add a product to cart with custom options type file jpg, but when I sent the request I got an error "message": "Please specify product's required option(s).",a part of code my request</p>
  
  <pre><code>"customOptions": [
                      {
                        "optionId": "2",
                        "optionValue": "data:image/jpeg;base64,/9j/4AAQSkZJRg...",
                        "extensionAttributes": {
                          "fileInfo": {
                            "base64EncodedData": "iVBORw0KGgoAAAANSUhEUgAAACgAAAAo....",
                            "type": "image/jpeg",
                            "name": "image.jpeg"
                          }
                        }
                      }
                    ]
  </code></pre>
  
  <p>and I also tried with</p>
  
  <pre><code>"customOptions": [
                      {
                        "optionId": "2",
                        "optionValue": "image.jpeg",
                        "extensionAttributes": {
                          "fileInfo": {
                            "base64EncodedData": "iVBORw0KGgoAAAANSUhEUgAA....",
                            "type": "image/jpeg",
                            "name": "image.jpeg"
                          }
                        }
                      }
                    ]
  </code></pre>