Skip to content

Commit 5857a92

Browse files
committed
Add range() and auth()
1 parent 5e421b8 commit 5857a92

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/builder.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,14 @@ impl Builder {
4242
}
4343
}
4444

45+
pub fn auth(mut self, token: &str) -> Self {
46+
self.headers.append(
47+
"Authorization",
48+
HeaderValue::from_str(&format!("Bearer {}", token)).unwrap(),
49+
);
50+
self
51+
}
52+
4553
// TODO: Multiple columns
4654
// TODO: Renaming columns
4755
// TODO: Casting columns
@@ -81,7 +89,7 @@ impl Builder {
8189
}
8290

8391
pub fn single(mut self) -> Self {
84-
self.headers.append(
92+
self.headers.insert(
8593
"Accept",
8694
HeaderValue::from_static("application/vnd.pgrst.object+json"),
8795
);

0 commit comments

Comments
 (0)