Skip to content

Commit 3c84cd4

Browse files
committed
Fix some builder behaviors
1 parent b4a417a commit 3c84cd4

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/builder.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ pub struct Builder {
1919
// TODO: Complex filters (not, and, or)
2020
// TODO: Exact, planned, estimated count (HEAD verb)
2121
// TODO: Response format
22-
// TODO: Embedded resources
23-
// TODO: Content type (csv, etc.)
22+
// TODO: Resource embedding (embedded filters, etc.)
23+
// TODO: Content-Type (text/csv, etc.)
2424
impl Builder {
2525
pub fn new<S>(url: S, schema: Option<String>) -> Self
2626
where
@@ -126,7 +126,7 @@ impl Builder {
126126
S: Into<String>,
127127
{
128128
self.method = Method::POST;
129-
self.headers.append(
129+
self.headers.insert(
130130
"Prefer",
131131
// Maybe check if this works as intended...
132132
HeaderValue::from_static("return=representation; resolution=merge-duplicates"),
@@ -143,7 +143,7 @@ impl Builder {
143143
{
144144
self.method = Method::PUT;
145145
self.headers
146-
.append("Prefer", HeaderValue::from_static("return=representation"));
146+
.insert("Prefer", HeaderValue::from_static("return=representation"));
147147
self.queries
148148
.push((primary_column.into(), format!("eq.{}", key.into())));
149149
self.body = Some(body.into());
@@ -156,15 +156,15 @@ impl Builder {
156156
{
157157
self.method = Method::PATCH;
158158
self.headers
159-
.append("Prefer", HeaderValue::from_static("return=representation"));
159+
.insert("Prefer", HeaderValue::from_static("return=representation"));
160160
self.body = Some(body.into());
161161
self
162162
}
163163

164164
pub fn delete(mut self) -> Self {
165165
self.method = Method::DELETE;
166166
self.headers
167-
.append("Prefer", HeaderValue::from_static("return=representation"));
167+
.insert("Prefer", HeaderValue::from_static("return=representation"));
168168
self
169169
}
170170

0 commit comments

Comments
 (0)