HTTPUtils.PostString Maximum Size?

stevel05

Expert
Licensed User
Longtime User
I am trying to communicate across the cloud with a file conversion site that has an API that allows conversion of files embedded within an XML file.

I am trying to send this via HTTPUtils.PostString, Their support is telling me that the file arriving is truncated, providing a corrupt image and therefore failing conversion. I just wanted to check before I spend too long investigating this, if there is a string size limit for use with HTTP.PostString.

The String I am trying to send is about 40kb including a Base64 encoded image.

The XML string is built like this:

B4X:
XML="<?xml version="&QUOTE&"1.0"&QUOTE&" encoding="&QUOTE&"utf-8"&QUOTE&" ?>"&CRLF
   XML=XML&"<queue>"&CRLF
   XML=XML&"  <apiKey>"&apiKey&"</apiKey>"&CRLF  'Private API Key
   XML=XML&"  <targetType>image</targetType>"&CRLF
   XML=XML&"  <targetMethod>convert-to-jpg</targetMethod>"&CRLF
   XML=XML&"  <testMode>true</testMode>"&CRLF
   
#Region Send URL   
   'either send source URL
   'XML=XML&"  <sourceUrl>http://www.stevelaming.co.uk/stevel05/images/icon72.png</sourceUrl>"&CRLF
#End Region

'#Region Embed File
   'Or embed a file ______________________________________________________
   
   Dim fileName,imageString As String
   Dim Image As Bitmap
   Dim out As OutputStream
   Dim fileData() As Byte
   Dim su As StringUtils
   
   fileName="testfile.png"
   imageString=" test encoded file goes here"
   XML=XML&"  <file>"&CRLF
   XML=XML&"    <fileName>"&fileName&"</fileName>"&CRLF
   XML=XML&"    <fileData>"&CRLF
   XML=XML&"      "&imageString&CRLF            'Image As string
   XML=XML&"    </fileData>"&CRLF
   XML=XML&"  </file>"&CRLF
   ' _____________________________________________________________________
'#End Region

   XML=XML&"</queue>"
   'Log("Xml "&XML)
   EditText1.text=XML
   URL="http://api.online-convert.com/queue-insert"
   HttpUtils.PostString("queue",URL,"queue="&XML)
 

stevel05

Expert
Licensed User
Longtime User
Thank Erel,

I'll do some digging.

Sent from my Hero using Tapatalk
 
Upvote 0

stevel05

Expert
Licensed User
Longtime User
Pretty much anything, just trying to see what's possible with Android over the cloud. Their web site is here.
 
Upvote 0
Top