@@ -51,6 +51,7 @@ export enum ContentType {
5151 Json = "application/json" ,
5252 FormData = "multipart/form-data" ,
5353 UrlEncoded = "application/x-www-form-urlencoded" ,
54+ Text = "text/plain" ,
5455}
5556
5657export class HttpClient < SecurityDataType = unknown > {
@@ -105,6 +106,7 @@ export class HttpClient<SecurityDataType = unknown> {
105106 private contentFormatters : Record < ContentType , ( input : any ) => any > = {
106107 [ ContentType . Json ] : ( input : any ) =>
107108 input !== null && ( typeof input === "object" || typeof input === "string" ) ? JSON . stringify ( input ) : input ,
109+ [ ContentType . Text ] : ( input : any ) => ( input !== null && typeof input !== "string" ? JSON . stringify ( input ) : input ) ,
108110 [ ContentType . FormData ] : ( input : any ) =>
109111 Object . keys ( input || { } ) . reduce ( ( formData , key ) => {
110112 const property = input [ key ] ;
@@ -270,4 +272,21 @@ export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDa
270272 ...params ,
271273 } ) ,
272274 } ;
275+ consumesPlainText = {
276+ /**
277+ * @description consumes plain text
278+ *
279+ * @name ConsumesPlainText
280+ * @summary consumes plain text
281+ * @request POST:/consumes-plain-text/
282+ */
283+ consumesPlainText : ( someParm : string , params : RequestParams = { } ) =>
284+ this . request < any , void > ( {
285+ path : `/consumes-plain-text/` ,
286+ method : "POST" ,
287+ body : someParm ,
288+ type : ContentType . Text ,
289+ ...params ,
290+ } ) ,
291+ } ;
273292}
0 commit comments