2

I am trying to write a python HTTP request code to send the data to Ant media server through one of its API. But I unable to send POST request however I was successful in GET requests.

import requests 
url = "http://localhost:5080/LiveApp/rest/broadcast/create"

body12 = {
    "name": "TESTAPIsss",
    "description":"hiiii",
    "type": "streamSource",
    "streamId":"650320906975923279669775",  
    "streamUrl": "rlink"
}
headers = {'content-type': 'application/json'}

x = requests.post(url, data=body12, headers=headers)

print(x.text)

The error which I am facing is

Unrecognized token 'name': was expecting 'null', 'true', 'false' or NaN at [Source: (org.glassfish.jersey.message.internal.ReaderInterceptorExecutor$UnCloseableInputStream); line: 1, column: 6]

MPA
  • 1,878
  • 2
  • 26
  • 51

1 Answers1

1

This answer is not working anymore.

Murat
  • 3,084
  • 37
  • 55