Executor-Cheng / ACRCloudSdkCore

Easy to recognize any music by using this sdk. Based on ACRCloud platform.
MIT License
3 stars 2 forks source link

'<' is an invalid start of a value. Path: $ | LineNumber: 0 | BytePositionInLine: 0. #9

Closed javapa closed 1 year ago

javapa commented 1 year ago

I want to do a basic search based on the contents of a file that's included in my demo project. I have tried the RecognizeByFileAsync method in 2 ways, first by referencing the file with the filepath and second by reading the bytes of the file, the exception is the same every time.

acrcloud_demo

Executor-Cheng commented 1 year ago

Thank you for your feedback! I assume it is because ACRCloud platform did not response in json format, prehaps in html? Now I'v added a check for the response format, throws UnknownResponseException, published the package in nuget, version 1.2.2-preview.1. You might check the property: UnknownResponseException.Response to find what they responses, and would you please provide it for solving the issue?

javapa commented 1 year ago

Hey, thank you for the fast reply! Now I can see that the endpoint (http://{{host}}.com/v2/identify) can't be found from the response.

acrcloud_demo_not_foundpng

If I go over to postman and execute a POST request to the same endpoint, but use version v1 I get a 200 OK response.

postman_post_acr

Executor-Cheng commented 1 year ago

Thank you! I found the api contract on global-docs and cn-docs It seems that the v2 api was obsoleted, but it is still avalible in china region. (link) I will fix it asap :)

javapa commented 1 year ago

It works now, awesome! Thank you!