"Unsupported Media Type" error for any Post Orchestrator API request starting from Orchestrator 2020.10

How to fix "Unsupported Media Type" error for any Post Orchestrator API request starting from Orchestrator 2020.10

UiPath swagger API specification describes that POST requests made to Orchestrator must have the request parameters included in a json in the request body. However, due to historical reasons, the web framework used before 20.10 also allowed making POST requests to our APIs with specifying request parameters as form parameters, even without specifying the proper Content-Type of application/x-www-form-urlencoded. This is not supported anymore.

Hence, the request parameters should be passed in json format in “Body” field of HTTP request activity. Also, the “BodyFormat” should be set to “Application/json”. Any of the below approaches can be followed to pass the body as json:-
i) By passing the complete json body in a single line string. Make sure to add extra " before " as escaping character.
e.g of request body :-
"{ ““tenancyName”” : ““default””, ““usernameOrEmailAddress”” : ““admin””, ““password”” : "“Uipath@123"”}"
Please refer the below screenshot.
Image_2020-11-10_14-13-50.png
ii) Writing the complete body in a text file. Read it using “Read Text File” activity and pass the output variable in “Body” field of HTTP request activity.