@@ -19,8 +19,8 @@ pub struct Builder {
19
19
// TODO: Complex filters (not, and, or)
20
20
// TODO: Exact, planned, estimated count (HEAD verb)
21
21
// 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.)
24
24
impl Builder {
25
25
pub fn new < S > ( url : S , schema : Option < String > ) -> Self
26
26
where
@@ -126,7 +126,7 @@ impl Builder {
126
126
S : Into < String > ,
127
127
{
128
128
self . method = Method :: POST ;
129
- self . headers . append (
129
+ self . headers . insert (
130
130
"Prefer" ,
131
131
// Maybe check if this works as intended...
132
132
HeaderValue :: from_static ( "return=representation; resolution=merge-duplicates" ) ,
@@ -143,7 +143,7 @@ impl Builder {
143
143
{
144
144
self . method = Method :: PUT ;
145
145
self . headers
146
- . append ( "Prefer" , HeaderValue :: from_static ( "return=representation" ) ) ;
146
+ . insert ( "Prefer" , HeaderValue :: from_static ( "return=representation" ) ) ;
147
147
self . queries
148
148
. push ( ( primary_column. into ( ) , format ! ( "eq.{}" , key. into( ) ) ) ) ;
149
149
self . body = Some ( body. into ( ) ) ;
@@ -156,15 +156,15 @@ impl Builder {
156
156
{
157
157
self . method = Method :: PATCH ;
158
158
self . headers
159
- . append ( "Prefer" , HeaderValue :: from_static ( "return=representation" ) ) ;
159
+ . insert ( "Prefer" , HeaderValue :: from_static ( "return=representation" ) ) ;
160
160
self . body = Some ( body. into ( ) ) ;
161
161
self
162
162
}
163
163
164
164
pub fn delete ( mut self ) -> Self {
165
165
self . method = Method :: DELETE ;
166
166
self . headers
167
- . append ( "Prefer" , HeaderValue :: from_static ( "return=representation" ) ) ;
167
+ . insert ( "Prefer" , HeaderValue :: from_static ( "return=representation" ) ) ;
168
168
self
169
169
}
170
170
0 commit comments