Posted on 12-21-2022 07:25 AM
I am trying to use JAMF School api for Teacher . It is working.
The one endpoint that I am having trouble with is changing the student photo
request.httpBody = fileData
// Either this for Content-Type Header
request.addValue("image/jpeg", forHTTPHeaderField: "Content-Type")
// or this for Multipart
request.addValue("multipart/form-data; charset=utf-8; boundary=__X_PAW_BOUNDARY__", forHTTPHeaderField: "Content-Type")
I would appreciate some example of the endpoint working, preferably in Swift, but any working example or instruction of what the endpoint is expecting, would be appreciated.
Steven
Posted on 01-23-2023 04:40 AM
Actually I didn't implemented this feature, but maybe try: content-type: application/octet-stream and properly set the content length. https://stackoverflow.com/questions/14365027/python-post-binary-data