Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9088431
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T21:54:27+00:00 2026-06-16T21:54:27+00:00

Good morning. I’m developing a small media player with built in support for audio

  • 0

Good morning.

I’m developing a small media player with built in support for audio recognition using the Echonest API. I’ve dealt with API’s before and know how to submit and parse results, but the other API’s provided simple POST/GET examples in their documentation thus opening it up to almost every situation regardless of language or platform.

The Echonest API however, only provides CURL examples. CURL is something I’ve never dealt with. I’m working in Delphi XE3, or Firemonkey 2 to be specific, and thus there’s no built in CURL library or components. There are a few third-party ones available, but I’m not confident they’re up to date as they’re listing Delphi 6 as being their development environment, and brief searches indicate they’re no longer working with modern versions of Delphi (whether this is true or not is a different story).

As I’m wanting to try and keep things as cross-platform as possible to potentially compile an OS X version at a future date, and feel confident in dealing with POST and GET already, how would I go about ‘translating’ this CURL command into something I could use with Indy (for example);

curl -F "api_key=FILDTEOIK2HBORODV" -F "filetype=mp3" -F "track=@audio.mp3" "http://developer.echonest.com/api/v4/track/upload"

This was taken directly from their API documentation, and is used for uploading a track to their service.

I’m not sure on the specifics regarding CURL and so before I go throwing random data at the service, I felt it best to see whether the SO community can give a brief explanation and example that I can work from. The explanation is much more valuable than the example in any case, but an example may serve well for anyone else who happens to stumble upon a similar problem.

Regards,
Scott Pritchard.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T21:54:28+00:00Added an answer on June 16, 2026 at 9:54 pm

    The -F option tells curl to POST the provided data using the HTTP "multipart/form-data" Content-Type, which looks like this at the HTTP layer:

    POST /api/v4/track/upload HTTP/1.1
    Host: developer.echonest.com
    Content-Type: multipart/form-data; boundary="boundaryvalue"
    
    --boundaryvalue
    Content-Disposition: form-data; name="api_key"
    
    FILDTEOIK2HBORODV
    --boundaryvalue
    Content-Disposition: form-data; name="filetype"
    
    mp3
    --boundaryvalue
    Content-Disposition: form-data; name="track"; filename="audio.mp3"
    Content-Type: audio/x-mpg
    
    <binary audio data here>
    --boundaryvalue--
    

    The Post() method of Indy’s TIdHTTP component implements that Content-Type via the TIdMultipartFormDataStream utility class, eg:

    uses
      ..., IdHTTP, IdMultipartFormData;
    
    var
      Data: TIdMultipartFormDataStream;
    begin
      Data := TIdMultipartFormDataStream.Create;
      try
        Data.AddFormField('api_key', 'FILDTEOIK2HBORODV');
        Data.AddFormField('filetype', 'mp3');
        Data.AddFile('track', 'C:\path to\audio.mp3');
        IdHTTP1.Post('http://developer.echonest.com/api/v4/track/upload', Data);
      finally
        Data.Free;
      end;
    end;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Good Morning, I am developing a four column footer using pure CSS, but I
Good Morning! I am writing a small AJAX application, using this function as a
Good morning, I am currently developing a java web application that exposes a web
Good morning gang. I have a jQuery Datepicker object that is prepoulated using a
Good morning, I have problem with using MasterPage and jQuery. I using jQuery UI
Good Morning! Given: public class FooClass { public void FooMethod() { using (var myEntity
Good Morning everyone, I am using an update command in php to update data
Good Morning SO Campers, I'm interested in developing a social networking site. It will
good morning programers, I have this small code which content a news control panel
Good morning, I am in need of some advice, I am using a networkStream,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.