Skip to content

Commit 1e5ddd1

Browse files
authored
Merge pull request #4 from pxsty0/master
refectored according to new api authentication usage
2 parents f098be3 + 92dc8ce commit 1e5ddd1

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "pxserv"
3-
version = "0.0.1"
3+
version = "1.0.0"
44
description = "PxServ Library for Rust"
55
edition = "2021"
66
authors = ["mustafa 'pxsty' kok <[email protected]>"]

src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ impl PxServ {
1919
let client = Client::new();
2020

2121
let request_body = json!({
22-
"apiKey":self.apikey,
2322
"key":key,
2423
"value":value
2524
});
2625

2726
let request = client
2827
.post("https://api.pxserv.net/database/setData")
28+
.header("apikey", self.apikey.to_string())
2929
.json(&request_body)
3030
.send();
3131

@@ -56,12 +56,12 @@ impl PxServ {
5656
let client = Client::new();
5757

5858
let request_body = json!({
59-
"apiKey":self.apikey,
6059
"key":key,
6160
});
6261

6362
let request = client
6463
.post("https://api.pxserv.net/database/getData")
64+
.header("apikey", self.apikey.to_string())
6565
.json(&request_body)
6666
.send();
6767

@@ -104,12 +104,12 @@ impl PxServ {
104104
let client = Client::new();
105105

106106
let request_body = json!({
107-
"apiKey":self.apikey,
108107
"key":key,
109108
});
110109

111110
let request = client
112111
.post("https://api.pxserv.net/database/removeData")
112+
.header("apikey", self.apikey.to_string())
113113
.json(&request_body)
114114
.send();
115115

0 commit comments

Comments
 (0)