Vocal Remover

부분 유료
분류별 Firdavs Shodiyev | 업데이트됨 2 месяца назад | Music
인기

9 / 10

지연 시간

15,858ms

서비스 수준

83%

Health Check

100%

모든 토론으로 돌아가기

Getting Internal Server Error 500

Rapid account: Info Oc K Sw I Kt F
info-ocKSwIKtF
2 месяца назад

Getting internal server wjile running on flutter, ApI working on postman & curl btw, Any solution to reslove this issue

Future<void> uploadFile(String audioFilePath, BuildContext context) async {
print(audioFilePath);

var dio = Dio();

var formData = FormData.fromMap({
  'fileName': await MultipartFile.fromFile(
    audioFilePath,
    filename: 'vibe.mp3',
    contentType: MediaType('audio', 'mpeg'),
  ),
});

try {
  var response = await dio.post(
    'https://vocal-remover.p.rapidapi.com/api/v2/FileUpload',
    data: formData,
    options: Options(
      method: 'POST',
      headers: {
        'X-RapidAPI-Host': 'vocal-remover.p.rapidapi.com',
        'X-RapidAPI-Key':
            'a4b9ff9474msh1e793djsn7af3d879b8fa',
      },
    ),
  );

  if (response.statusCode == 200) {
    print(response.data);
  } else {
    print(response.statusMessage);
  }
} catch (e) {
  print('Error uploading file: $e');
}

}

Rapid account: Firdavscoder 1
firdavscoder1 Commented 2 месяца назад
Rapid account: Info Oc K Sw I Kt F
info-ocKSwIKtF Commented 2 месяца назад

hi, I have done everything there is, looks like the api is not compatible with dart, my guess is headers are being handled case sensitively by the server (i.e. it is not in compliance with the RFC), dart force converts everything in headers to lowercase, i have checked the log and request from postman is working because headers are on original case but when using flutter it gets converted to lowercase

Also when requesting from dart request body is 100 and from postman its 99,
ps - one more person in discussion also mentioned same error, ie -internal server error 500

Rapid account: Info Oc K Sw I Kt F
info-ocKSwIKtF Commented 2 месяца назад

Is there any specific file upload requirements. this is the response body returned by server

<!doctype html><html lang=“en”><head><title>HTTP Status 500 – Internal Server Error</title><style type=“text/css”>body {font-family:Tahoma,Arial,sans-serif;} h1, h2, h3, b {color:white;background-color:#525D76;} h1 {font-size:22px;} h2 {font-size:16px;} h3 {font-size:14px;} p {font-size:12px;} a {color:black;} .line {height:1px;background-color:#525D76;border:none;}</style></head><body><h1>HTTP Status 500 – Internal Server Error</h1><hr class=“line” /><p><b>Type</b> Exception Report</p><p><b>Message</b> The multi-part request contained parameter data (excluding uploaded files) that exceeded the limit for maxPostSize set on the associated connector</p><p><b>Description</b> The server encountered an unexpected condition that prevented it from fulfilling the request.</p><p><b>Exception</b></p><pre>java.lang.IllegalStateException: The multi-part request contained parameter data (excluding uploaded files) that exceeded the limit for maxPostSize set on the associated connector org.apach

Rapid account: Firdavscoder 1
firdavscoder1 Commented 2 месяца назад

Hi. It is not due to API error but rather you might not request data correctly. Ask any flutter experts to solve this issue.

아래에 의견을 추가하고 토론에 참여하세요.

새 댓글을 게시하려면 로그인 / 가입