Skip to content

Commit 1d67916

Browse files
authored
Merge pull request #110412 from Blackmist/binary-data
example client and additional clarifying text for binary posts
2 parents 4aa2d22 + 109a2e5 commit 1d67916

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

articles/machine-learning/how-to-deploy-and-where.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1119,6 +1119,16 @@ def run(request):
11191119
> pip install azureml-contrib-services
11201120
> ```
11211121

1122+
The `AMLRequest` class only allows you to access the raw posted data in the score.py, there is no client-side component. From a client, you post data as normal. For example, the following Python code reads an image file and posts the data:
1123+
1124+
```python
1125+
import requests
1126+
# Load image data
1127+
data = open('example.jpg', 'rb').read()
1128+
# Post raw data to scoring URI
1129+
res = request.post(url='<scoring-uri>', data=data, headers={'Content-Type': 'application/octet-stream'})
1130+
```
1131+
11221132
<a id="cors"></a>
11231133

11241134
### Cross-origin resource sharing (CORS)

0 commit comments

Comments
 (0)