I know that you can set the origin in cURL using a -H header like this:
curl -H "Origin: http://foo.bar.com" --verbose \\ https://example.com