Skip to content

Commit 7347bcd

Browse files
committed
refactor(req)!: rename url encoded body function
1 parent 4968853 commit 7347bcd

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/request.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,12 @@ class HttpRequestBuilder {
7878
return this;
7979
}
8080

81+
public setFormUrlEncodedBody(searchParams: URLSearchParams): this {
82+
this.body = searchParams.toString();
83+
this.headers.set(HeaderKeys.CONTENT_TYPE, "application/x-www-form-urlencoded");
84+
return this;
85+
}
86+
8187
public setHeader(key: string, value: string): this {
8288
this.headers.set(key, value);
8389
return this;
@@ -99,12 +105,6 @@ class HttpRequestBuilder {
99105
return this;
100106
}
101107

102-
public setSearchParamsBody(searchParams: URLSearchParams): this {
103-
this.body = searchParams.toString();
104-
this.headers.set(HeaderKeys.CONTENT_TYPE, "application/x-www-form-urlencoded");
105-
return this;
106-
}
107-
108108
public setUrlSearchParameter(key: string, value: string): this {
109109
this.url.searchParams.set(key, value);
110110
return this;

0 commit comments

Comments
 (0)