简体   繁体   English

如何使用curl查询echoprint本地服务器?

[英]How to query echoprint local server using curl?

I am very new to echonest and curl. 我对回声和卷曲非常陌生。 I have an up and running echoprint server and echoprint codegen is also working fine. 我有一台正在运行的echoprint服务器,并且echoprint codegen也可以正常工作。 I am able to push codes to my local server using ingest method. 我可以使用摄取方法将代码推送到本地服务器。

But I don't know how to query the server using the curl request. 但是我不知道如何使用curl请求查询服务器。

How can I send the syntax or example of the curl request for querying the echoprint server? 如何发送curl请求的语法或示例来查询echoprint服务器?

Once you are up with code parsed by codegen library you can always call api layer for ingest, sample code where i use PHP script top of the echoprint server 一旦您掌握了由codegen库解析的代码,就可以随时调用api层以获取示例代码,其中我在echoprint服务器的顶部使用PHP脚本

            $curl = curl_init();
            curl_setopt_array( $curl, array(
            CURLOPT_RETURNTRANSFER => 1,
            CURLOPT_URL => 'http://localhost:8080/ingest',
            CURLOPT_USERAGENT => 'URl Request',
            CURLOPT_POST => 1,
            CURLOPT_POSTFIELDS => array(
                'fp_code' => $songcode,
                'track_id' => $trackid,
                'length'=>$length,
                'artist' => $artist,
                'codever' => $codecover
            )
        ) );
    $resp = curl_exec( $curl );
    curl_close( $curl );

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM