summaryrefslogtreecommitdiffstats
path: root/third_party/rust/glean/src/net/http_uploader.rs
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/rust/glean/src/net/http_uploader.rs')
-rw-r--r--third_party/rust/glean/src/net/http_uploader.rs24
1 files changed, 24 insertions, 0 deletions
diff --git a/third_party/rust/glean/src/net/http_uploader.rs b/third_party/rust/glean/src/net/http_uploader.rs
new file mode 100644
index 0000000000..076e005704
--- /dev/null
+++ b/third_party/rust/glean/src/net/http_uploader.rs
@@ -0,0 +1,24 @@
+// This Source Code Form is subject to the terms of the Mozilla Public
+// License, v. 2.0. If a copy of the MPL was not distributed with this
+// file, You can obtain one at https://mozilla.org/MPL/2.0/.
+
+use crate::net::{PingUploader, UploadResult};
+
+/// A simple mechanism to upload pings over HTTPS.
+#[derive(Debug)]
+pub struct HttpUploader;
+
+impl PingUploader for HttpUploader {
+ /// Uploads a ping to a server.
+ ///
+ /// # Arguments
+ ///
+ /// * `url` - the URL path to upload the data to.
+ /// * `body` - the serialized text data to send.
+ /// * `headers` - a vector of tuples containing the headers to send with
+ /// the request, i.e. (Name, Value).
+ fn upload(&self, url: String, _body: Vec<u8>, _headers: Vec<(String, String)>) -> UploadResult {
+ log::debug!("TODO bug 1675468: submitting to {:?}", url);
+ UploadResult::HttpStatus(200)
+ }
+}