You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have an endpoint that should use application/x-www-form-urlencoded but the data is sent as a json string with the content type being application/x-www-form-urlencoded.
I got this function generated:
/** * This method provides access to the full `HttpResponse`, allowing access to response headers. * To access only the response body, use `authAccessToken()` instead. * * This method sends `application/x-www-form-urlencoded` and handles request body of type `application/x-www-form-urlencoded`. */authAccessToken$Response(params?: {body?: {'grant_type': string,'scope'?: string,'client_id'?: string,'client_secret'?: string}}): Observable<StrictHttpResponse<TokenAuthenticateResult>>{
const rb=newRequestBuilder(this.rootUrl,AuthService.AuthAccessTokenPath,'post');if(params){rb.body(params.body,'application/x-www-form-urlencoded');}returnthis.http.request(rb.build({responseType: 'json',accept: 'application/json'})).pipe(filter((r: any)=>rinstanceofHttpResponse),map((r: HttpResponse<any>)=>{returnrasStrictHttpResponse<TokenAuthenticateResult>;}));}
But the problem seems to be in: rb.body which has this content:
body(value: any,contentType='application/json'): void{if(valueinstanceofBlob){this._bodyContentType=value.type;}else{this._bodyContentType=contentType;}if((this._bodyContentType||'').startsWith('multipart/form-data')){// Handle multipart form dataconstformData=newFormData();if(value!=null){for(constkeyofObject.keys(value)){constval=value[key];if(valinstanceofArray){for(constvofval){consttoAppend=this.formDataValue(v);if(toAppend!==null){formData.append(key,toAppend);}}}else{consttoAppend=this.formDataValue(val);if(toAppend!==null){formData.set(key,toAppend);}}}}this._bodyContent=formData;}else{// The body is the plain contentthis._bodyContent=value;}}
Probably there needs to be a check for application/x-www-form-urlencoded also?
The text was updated successfully, but these errors were encountered:
I have an endpoint that should use
application/x-www-form-urlencoded
but the data is sent as a json string with the content type beingapplication/x-www-form-urlencoded
.I got this function generated:
But the problem seems to be in:
rb.body
which has this content:Probably there needs to be a check for
application/x-www-form-urlencoded
also?The text was updated successfully, but these errors were encountered: