File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -864,12 +864,6 @@ export default class ApiRequest extends LitElement {
864864 }
865865 } ) ;
866866 fetchOptions . body = formDataParams ;
867- } else if ( mediaFileRegex . test ( requestBodyType ) || textFileRegex . test ( requestBodyType ) ) {
868- const bodyParamFileEl = requestPanelEl . querySelector ( '.request-body-param-file' ) ;
869- if ( bodyParamFileEl && bodyParamFileEl . files [ 0 ] ) {
870- fetchOptions . body = bodyParamFileEl . files [ 0 ] ;
871- curlData = ` \\\n --data-binary @${ bodyParamFileEl . files [ 0 ] . name } ` ;
872- }
873867 } else if ( requestBodyType . includes ( 'json' ) || requestBodyType . includes ( 'xml' ) || requestBodyType . includes ( 'text' ) ) {
874868 const exampleTextAreaEl = requestPanelEl . querySelector ( '.request-body-param-user-input' ) ;
875869 if ( exampleTextAreaEl && exampleTextAreaEl . value ) {
@@ -888,6 +882,12 @@ export default class ApiRequest extends LitElement {
888882 curlData = ` \\\n -d '${ fetchOptions . body . replace ( / ' / g, '\'"\'"\'' ) } '` ;
889883 }
890884 }
885+ } else if ( mediaFileRegex . test ( requestBodyType ) || textFileRegex . test ( requestBodyType ) ) {
886+ const bodyParamFileEl = requestPanelEl . querySelector ( '.request-body-param-file' ) ;
887+ if ( bodyParamFileEl && bodyParamFileEl . files [ 0 ] ) {
888+ fetchOptions . body = bodyParamFileEl . files [ 0 ] ;
889+ curlData = ` \\\n --data-binary @${ bodyParamFileEl . files [ 0 ] . name } ` ;
890+ }
891891 }
892892 // Common for all request-body
893893 if ( ! requestBodyType . includes ( 'form-data' ) ) {
You can’t perform that action at this time.
0 commit comments