# httpPost Multipart Question

**URL:** <https://forum.servoy.com/t/httppost-multipart-question/24014>\
**Category:** Questions\
**Created:** [June 23, 2025, 3:21pm UTC](https://forum.servoy.com/t/httppost-multipart-question/24014 "2025-06-23T15:21:55Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![vik.lamp.vl](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/vik.lamp.vl/32/4447_2.png) [@vik.lamp.vl](https://forum.servoy.com/u/vik.lamp.vl)\
**Post date:** [June 23, 2025, 3:21pm UTC](https://forum.servoy.com/t/httppost-multipart-question/24014/1 "2025-06-23T15:21:55Z")

</div>

Hey guys,  
quick question because im stuck at a http multipart thing.

Im trying to post a mp3 to the groq api, which is just a small speach-to-text thing. Via postman it works perfectly fine.

If i do a simple multipart post request, like i do at other parts without a problem i get the following response:

`{"error":{"message":"multipart: NextPart: EOF","type":"invalid_request_error"}}`  
Im thinking it has something todo with the mutlipart boundary.

Here is my code, maybe one of you has a idea:

```auto
function transcribeVoiceMail(){
	var loFs = forms.email_inbox_list.foundset
	if(!loFs || !loFs.getSelectedRecord()){
        return
	}
	
	var lrRecord = loFs.getSelectedRecord()
	if(utils.stringTrim(lrRecord.Betreff).toLowerCase().indexOf('voicemail') < 0){
        plugins.webnotificationsToastr.info('Diese E-Mail enthält keine Voicemail!')
        return
	}
	
	// --- check if there are any attachments ---
	if(!databaseManager.hasRecords(lrRecord.mail_messages_to_mail_attachments)){
        plugins.webnotificationsToastr.info('Diese E-Mail enthält keine Anhänge!')
        return
	}
	
	var mp3Bytes = lrRecord.mail_messages_to_mail_attachments.getRecord(1).data
	if (!mp3Bytes) {
		plugins.dialogs.showErrorDialog("Fehler", "Keine MP3-Daten im Anhang gefunden.");
		return;
	}
	
	var jsFile = plugins.file.createTempFile('voice','.mp3')
	jsFile.setBytes(mp3Bytes)
		
    var client = plugins.http.createNewHttpClient()
	var request = client.createPostRequest('https://api.groq.com/openai/v1/audio/transcriptions')
	request.forceMultipart(true)
	
	request.addHeader('Authorization','Bearer gsk_XXX')
	request.addHeader('Accept','application/json')
	
	request.addFile('file','voicemail.mp3',jsFile,'audio/mpeg')
	request.addParameter('model','whisper-large-v3')
	request.addParameter('language','de')
	
	var response = request.executeRequest()

	if (response.getStatusCode() == 200) {
		var result = JSON.parse(response.getResponseBody());
		plugins.dialogs.showInfoDialog("Transkription", result['text']);
	} else {
		plugins.dialogs.showErrorDialog("Fehler", "Groq API antwortete mit Status: " + response.getStatusCode());
		application.output(response.getResponseBody())
	}
	
	client.close()
	
}

```

Using Servoy Version: 2025.3.1.4043  
Greetings and thanks

---

<div class="post-metadata">

**Author:** ![jcompagner](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/jcompagner/32/4889_2.png) [@jcompagner](https://forum.servoy.com/u/jcompagner)\
**Post date:** [June 23, 2025, 3:28pm UTC](https://forum.servoy.com/t/httppost-multipart-question/24014/2 "2025-06-23T15:28:48Z")

</div>

and how does the postman request look like?

---

<div class="post-metadata">

**Author:** ![vik.lamp.vl](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/vik.lamp.vl/32/4447_2.png) [@vik.lamp.vl](https://forum.servoy.com/u/vik.lamp.vl)\
**Post date:** [June 24, 2025, 7:03am UTC](https://forum.servoy.com/t/httppost-multipart-question/24014/3 "2025-06-24T07:03:54Z")

</div>

I attached a Screenshot of my Postman. Plus the Authorization is set to Bearer Token, with my Token.

 ![grafik](https://canada1.discourse-cdn.com/flex010/uploads/servoy/original/2X/0/009daf1a007fe34b6778ce5bff769d9ed78a069a.png)  
 ![grafik](https://canada1.discourse-cdn.com/flex010/uploads/servoy/original/2X/3/3d58d095d1f733a507fb2747e8111af525b0108e.png)

---

<div class="post-metadata">

**Author:** ![lvostinar](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/lvostinar/32/5248_2.png) [@lvostinar](https://forum.servoy.com/u/lvostinar)\
**Post date:** [June 24, 2025, 7:19am UTC](https://forum.servoy.com/t/httppost-multipart-question/24014/4 "2025-06-24T07:19:01Z")

</div>

Can you try changing [HttpClientConfig | Docs](https://docs.servoy.com/reference/servoyextensions/server-plugins/http/httpclientconfig#multipartlegacymode) and [HttpClientConfig | Docs](https://docs.servoy.com/reference/servoyextensions/server-plugins/http/httpclientconfig#forcehttp1) for your http client ? Also, I see no Servoy code for cookie, maybe that could be the reason of failure ?

---

<div class="post-metadata">

**Author:** ![vik.lamp.vl](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/vik.lamp.vl/32/4447_2.png) [@vik.lamp.vl](https://forum.servoy.com/u/vik.lamp.vl)\
**Post date:** [June 24, 2025, 8:01am UTC](https://forum.servoy.com/t/httppost-multipart-question/24014/5 "2025-06-24T08:01:21Z")

</div>

Hi Ivostinar,

`config.forceHttp1 = true` fixed the issue. Thanks alot.
