How to post image with fetch?

according to this https://muffinman.io/uploading-files-using-fetch-multipart-form-data it works in different way, at least for me it works as well. const fileInput = document.querySelector(‘#your-file-input’) ; const formData = new FormData(); formData.append(‘file’, fileInput.files[0]); const options = { method: ‘POST’, body: formData, // If you add this, upload won’t work // headers: { // ‘Content-Type’: ‘multipart/form-data’, // } }; fetch(‘your-upload-url’, … Read more

Http Post with indy

Indy has TIdMultipartFormDataStream for this purpose: procedure TForm1.SendPostData; var Stream: TStringStream; Params: TIdMultipartFormDataStream; begin Stream := TStringStream.Create(”); try Params := TIdMultipartFormDataStream.Create; try Params.AddFile(‘File1’, ‘C:\test.txt’,’application/octet-stream’); try HTTP.Post(‘http://posttestserver.com/post.php’, Params, Stream); except on E: Exception do ShowMessage(‘Error encountered during POST: ‘ + E.Message); end; ShowMessage(Stream.DataString); finally Params.Free; end; finally Stream.Free; end; end;

Post JSON to web in excel vba

JSON can be very sensitive to how it’s formatted, so I would make sure everything is quoted properly before it is sent. I would recommend splitting Body into a separate variable and debugging the value with http://jsonformatter.curiousconcept.com/ before sending. Dim Body As String Body = “{“”mType””:””OPEN_SYSTEM_TRADE””,””systemOwnerId””:10}” ‘ Set breakpoint here, get the Body value, and … Read more

How to send an image to an api in dart/flutter?

The simplest method would be to post a multipart request like in this post and then post it to the server. Make sure to import these in the beginning of the file: import ‘package:path/path.dart’; import ‘package:async/async.dart’; import ‘dart:io’; import ‘package:http/http.dart’ as http; import ‘dart:convert’; Add this class somewhere in your code: upload(File imageFile) async { … Read more

Maximum default POST request size of IIS 7 – how to increase 64kB/65kB limit?

John Källén’s answer was correct, but in my case I had an end point defined so setting the maxReceivedMessageSize had to be as follows: <standardEndpoints> <webHttpEndpoint> <standardEndpoint name=”” helpEnabled=”true” automaticFormatSelectionEnabled=”true” maxReceivedMessageSize=”2147483647″> </standardEndpoint> </webHttpEndpoint> </standardEndpoints>