I am trying to create a simple application with rest api in python and i am getting error. Please look below my code and error log
PYTHON SCRIPT
import requests
from requests.auth import HTTPDigestAuth
headers = {
‘Content-Type’: ‘application/json; charset=utf-8’,
‘Accept’: ‘application/json; charset=utf-8’
}
data = {
“restURI”: “http://localhost:8087/v2/servers/defaultServer/vhosts/defaultVHost/applications/testlive”,
“name”: “testlive”,
“appType”: “Live”,
“clientStreamReadAccess”: “",
“clientStreamWriteAccess”: "”,
“description”: “A basic live application”,
“streamConfig”: {
“restURI”: “http://localhost:8087/v2/servers/defaultServer/vhosts/defaultVHost/applications/testlive/streamconfiguration”,
“streamType”: “live”
}
}
url = “http://localhost:8087/v2/servers/defaultServer/vhosts/defaultVHost/applications/testlive”
r = requests.post(url,headers=headers,auth=HTTPDigestAuth(‘username’, ‘password’))
r.json()
RESPONSE:
{‘code’: ‘500’,
‘message’: ‘The server encountered an unexpected condition which prevented it from fulfilling the request’,
‘success’: False,
‘wowzaServer’: ‘4.7.8’}
ERROR LOG:
ERROR server comment 2020-02-03 08:11:45 - - - - - 238714.72 - - - - - - - - class com.wowza.wms.rest.vhosts.applications.ApplicationConfig.post : java.lang.IllegalArgumentException: argument “src” is null|at com.fasterxml.jackson.databind.ObjectReader._assertNotNull(ObjectReader.java:2120)|at com.fasterxml.jackson.databind.ObjectReader.readValue(ObjectReader.java:1224)|at org.restlet.ext.jackson.JacksonRepresentation.getObject(JacksonRepresentation.java:309)|at com.wowza.wms.rest.ConfigBase.getObject(ConfigBase.java:2782)|at com.wowza.wms.rest.ConfigBase.post(ConfigBase.java:3575)|