Hello,
I’m using Wowza Streaming Engine 4.8.5
I can successfully access the Wowza Streaming Engine API using the cURL commands such as the one below, but cannot get the equivalent to work in javascript using fetch(). Can anyone provide any guidance? I’m using Vanilla JS.
curl --digest -u "wowza:i-myAWSinstanceID" -X GET \
-H 'Accept:application/json; charset=utf-8' \
-H 'Content-Type:application/json; charset=utf-8' \
http://3.90.142.82:8087/v3/servers/_defaultServer_/publishers
However the equivalent javascript fetch() will fail:
fetch("http://3.90.142.82:8087/v3/servers/_defaultServer_/publishers", {
headers: {
Accept: "application/json; charset=utf-8",
Authorization: "Basic d293emE6aS1teUFXU2luc3RhbmNlSUQ=",
"Content-Type": "application/json; charset=utf-8"
}
})
And I receive the following authentication errors:
1. body: (...)
2. bodyUsed: true
3. headers: Headers {}
4. ok: false
5. redirected: false
6. status: 401
7. statusText: "Unauthorized"
8. type: "cors"
9. url: "http://3.90.142.82:8087/v3/servers/_defaultServer_/publishers"
With the following JSON response:
1. code: "401"
2. message: "The request requires user authentication"
3. success: false
4. wowzaServer: "4.8.5"
Are there any javascript examples for accessing the Wowza Streaming Engine API?