diff options
| author | Josh Ferrell <josh@vector35.com> | 2024-10-01 14:14:10 -0400 |
|---|---|---|
| committer | Josh Ferrell <josh@vector35.com> | 2024-10-01 14:14:10 -0400 |
| commit | fc28e5142593e69a960ab8dd72ff88a2f06065da (patch) | |
| tree | 7353a6e13aadd1f5ac79e0569a3325c242079eb3 /http.cpp | |
| parent | 998f3f7dfa79a742575ee118ffc629e542dd9790 (diff) | |
Improve c++ http api performance
Diffstat (limited to 'http.cpp')
| -rw-r--r-- | http.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
@@ -229,7 +229,7 @@ namespace BinaryNinja::Http } - Request::Request(string method, string url, unordered_map<string, string> headers, + Request::Request(string method, string url, const unordered_map<string, string>& headers, vector<pair<string, string>> params, std::function<bool(size_t, size_t)> downloadProgress, std::function<bool(size_t, size_t)> uploadProgress) : m_method(method), @@ -252,7 +252,7 @@ namespace BinaryNinja::Http } - Request::Request(string method, string url, unordered_map<string, string> headers, + Request::Request(string method, string url, const unordered_map<string, string>& headers, vector<pair<string, string>> params, vector<uint8_t> body, std::function<bool(size_t, size_t)> downloadProgress, std::function<bool(size_t, size_t)> uploadProgress) : m_method(method), @@ -276,7 +276,7 @@ namespace BinaryNinja::Http } - Request::Request(string method, string url, unordered_map<string, string> headers, + Request::Request(string method, string url, const unordered_map<string, string>& headers, vector<pair<string, string>> params, vector<pair<string, string>> formFields, std::function<bool(size_t, size_t)> downloadProgress, std::function<bool(size_t, size_t)> uploadProgress) : m_method(method), @@ -303,7 +303,7 @@ namespace BinaryNinja::Http } - Request::Request(string method, string url, unordered_map<string, string> headers, + Request::Request(string method, string url, const unordered_map<string, string>& headers, vector<pair<string, string>> params, vector<MultipartField> formFields, std::function<bool(size_t, size_t)> downloadProgress, std::function<bool(size_t, size_t)> uploadProgress) : m_method(method), @@ -331,31 +331,31 @@ namespace BinaryNinja::Http } - Request Request::Get(string url, unordered_map<string, string> headers, vector<pair<string, string>> params, + Request Request::Get(string url, const unordered_map<string, string>& headers, const vector<pair<string, string>>& params, std::function<bool(size_t, size_t)> downloadProgress, std::function<bool(size_t, size_t)> uploadProgress) { return Request("GET", url, headers, params, downloadProgress, uploadProgress); } - Request Request::Post(string url, unordered_map<string, string> headers, vector<pair<string, string>> params, - vector<uint8_t> body, std::function<bool(size_t, size_t)> downloadProgress, + Request Request::Post(string url, const unordered_map<string, string>& headers, const vector<pair<string, string>>& params, + const vector<uint8_t>& body, std::function<bool(size_t, size_t)> downloadProgress, std::function<bool(size_t, size_t)> uploadProgress) { return Request("POST", url, headers, params, body, downloadProgress, uploadProgress); } - Request Request::Post(string url, unordered_map<string, string> headers, vector<pair<string, string>> params, - vector<pair<string, string>> formFields, std::function<bool(size_t, size_t)> downloadProgress, + Request Request::Post(string url, const unordered_map<string, string>& headers, const vector<pair<string, string>>& params, + const vector<pair<string, string>>& formFields, std::function<bool(size_t, size_t)> downloadProgress, std::function<bool(size_t, size_t)> uploadProgress) { return Request("POST", url, headers, params, formFields, downloadProgress, uploadProgress); } - Request Request::Post(string url, unordered_map<string, string> headers, vector<pair<string, string>> params, - vector<MultipartField> formFields, std::function<bool(size_t, size_t)> downloadProgress, + Request Request::Post(string url, const unordered_map<string, string>& headers, const vector<pair<string, string>>& params, + const vector<MultipartField>& formFields, std::function<bool(size_t, size_t)> downloadProgress, std::function<bool(size_t, size_t)> uploadProgress) { return Request("POST", url, headers, params, formFields, downloadProgress, uploadProgress); |
