Hi,
I'd like to know whether it is possible from linux to post data to server with basic authentication to send data in base64 encoding using rest api. Unfortunately could not find purebasic example, only Java and C# for Windows implementations available in internet.
In linux rest post example with basic authentication and base64 image in the body part
Re: In linux rest post example with basic authentication and base64 image in the body part
viewtopic.php?p=521613#p521613
Code: Select all
*Auth = UTF8("User:Password")
If *Auth
Auth$ = Base64Encoder(*Auth, MemorySize(*Auth))
FreeMemory(*Auth)
EndIf
Header$ + "Authorization: Basic " + Auth$ + #CRLF$
Last edited by infratec on Wed Apr 05, 2023 8:27 pm, edited 3 times in total.
Re: In linux rest post example with basic authentication and base64 image in the body part
Thank You very much for reply.
What if the Base64 encoded string length is greater than 65K, assume 10MB.
Should it work with SendNetworkString or SendNetworkData in one send or should it be separated and sent in loop until all data sent?
What if the Base64 encoded string length is greater than 65K, assume 10MB.
Should it work with SendNetworkString or SendNetworkData in one send or should it be separated and sent in loop until all data sent?
Re: In linux rest post example with basic authentication and base64 image in the body part
Why does someone send a large file in base64
It is simply larger and has no benefits.

It is simply larger and has no benefits.
Re: In linux rest post example with basic authentication and base64 image in the body part
What if in case large file? Sender doesn't care about size, just select photo by thumbview (Due to camera high quality issue size of images above 1 megabytes) and push the button. And question is whether the solution link You mentioned applicable to such bigger than 65K (usually 1-3 megabytes) files?
Re: In linux rest post example with basic authentication and base64 image in the body part
You should be able to send large files. (I never tried it with PB, so simply give it a try)
But still: base64 is always 30% larger then the binary file.
But still: base64 is always 30% larger then the binary file.
Re: In linux rest post example with basic authentication and base64 image in the body part
Thank You very much for reply.
You mean it is possible sending large file in only one post without breaking into smaller parts in a loop?
Then what about TCP packet size limitation?
You mean it is possible sending large file in only one post without breaking into smaller parts in a loop?
Then what about TCP packet size limitation?