HttpClient request for curl --data-binary

How do you format request from the following command line?
curl -X POST -H “Content-Type: image/jpeg” --data-binary @myfile.jpg url

Have tried the following but doesn’t work:
$request = $client->createRequest()
->setHeaders([‘Content-type’ => ‘image/jpeg’])
->addFile(‘file’, ‘myfile.jpg’)