oauth-v2-client
Version:
Oauth V2 client based on axios
18 lines (15 loc) • 438 B
text/typescript
import { stringify } from "querystring";
import { RequestBodyType } from "../interfaces";
/**
* Format request according to the body type
* @param bodyType request body type
* @param body request body
*/
export default function renderRequestBody(bodyType: RequestBodyType, body: any): any {
switch (bodyType) {
case "x-www-form-urlencoded":
return stringify(body);
default:
return body;
}
}