Quantcast
Channel: The Echo Nest Developer Forum
Viewing all articles
Browse latest Browse all 1582

Issues with post request

$
0
0

Hi, I am trying to make a post request to your servers to get details on an mp3 file stored locally on my computer. I am trying to do this using jquery but when I make the request I receive the following error:

"Analysis is not possible because the track couldn't be decoded"

The code I have is as follows:

$.post("http://developer.echonest.com/api/v4/track/upload?", { "api_key":"API_KEY", "filetype": "mp3", "track": "@mrtambourine.mp3" }, function( data ) { console.log( data ); }, "JSON" ); })

I think the issue is that I am not setting ("Content-Type", "application/octet-stream");

Can someone confirm that this is infact the case, and if so where in the request this needs to be set to make it work. I have tried add it in the object I am sending but that returns an error saying:

{"response": {"status": {"version": "4.2", "code": 5, "message": "method - Invalid parameter: "Content-Type""}}}

Any help here would be greatly appreciated.

Apologies if this is a stupid question, I am quite new to all of this.

Thanks, Paul


Viewing all articles
Browse latest Browse all 1582

Trending Articles