minor changes

This commit is contained in:
kdeng00
2019-08-10 10:49:40 -04:00
parent 271921d55b
commit 27aecc7a0d
12 changed files with 30 additions and 187 deletions
-20
View File
@@ -33,26 +33,6 @@ namespace Syncers
#pragma
void Download::downloadSong(const int id)
{
string urlRoot = "http://192.168.1.5";
int port = 9349;
string endpoint = "api/song/data/" + std::to_string(id);
string url = urlRoot + ":" + std::to_string(port) + "/" +
endpoint;
auto r = cpr::Get(cpr::Url{url});
const char* newBuff = r.text.c_str();
int bufferLength = r.text.size();
ofstream saveSong{downloadFilePath, ofstream::binary};
saveSong.write(newBuff, bufferLength);
cout<<"HTTP status code: "<<r.status_code<<endl;
cout<<"Header info: "<<r.header["content-type"]<<endl;
cout<<"Header info: "<<endl;
cout<<r.header["content-type"]<<endl;
cout<<r.header["content-disposition"]<<endl;
}
void Download::downloadSong(const Token token, Song song)
{
try