Mercurial > hg > orthanc
comparison OrthancServer/OrthancRestApi/OrthancRestModalities.cpp @ 806:557575fd93e9
refactoring
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 07 May 2014 15:22:28 +0200 |
parents | d466b3606aca |
children | 566a2fb3c1fb |
comparison
equal
deleted
inserted
replaced
805:56a813a4714d | 806:557575fd93e9 |
---|---|
383 if (!GetInstancesToExport(instances, remote, call)) | 383 if (!GetInstancesToExport(instances, remote, call)) |
384 { | 384 { |
385 return; | 385 return; |
386 } | 386 } |
387 | 387 |
388 std::string url, username, password; | 388 OrthancPeerParameters peer; |
389 GetOrthancPeer(remote, url, username, password); | 389 GetOrthancPeer(peer, remote); |
390 | 390 |
391 // Configure the HTTP client | 391 // Configure the HTTP client |
392 HttpClient client; | 392 HttpClient client; |
393 if (username.size() != 0 && password.size() != 0) | 393 if (peer.GetUsername().size() != 0 && |
394 { | 394 peer.GetPassword().size() != 0) |
395 client.SetCredentials(username.c_str(), password.c_str()); | 395 { |
396 } | 396 client.SetCredentials(peer.GetUsername().c_str(), |
397 | 397 peer.GetPassword().c_str()); |
398 client.SetUrl(url + "instances"); | 398 } |
399 | |
400 client.SetUrl(peer.GetUrl() + "instances"); | |
399 client.SetMethod(HttpMethod_Post); | 401 client.SetMethod(HttpMethod_Post); |
400 | 402 |
401 // Loop over the instances that are to be sent | 403 // Loop over the instances that are to be sent |
402 for (std::list<std::string>::const_iterator | 404 for (std::list<std::string>::const_iterator |
403 it = instances.begin(); it != instances.end(); ++it) | 405 it = instances.begin(); it != instances.end(); ++it) |