Re: HTTP Body Size

2018-02-08 Thread Douglas Cryer via 4D_Tech
Re:

> On 8 Feb 2018, at 15:57, 4d_tech-requ...@lists.4d.com 
>  wrote:
> 
> I wouldn't do this, it trims the BLOB at 32K unless you specify the UTF8 
> constants (see docs).
> you might want to consider CONVERT FROM TEXT instead.
> 
>> 2018/02/08 17:36、Douglas Cryer via 4D_Tech <4d_tech@lists.4d.com 
>> > のメール:
>> TEXT TO BLOB($vt_Request;$vx_Request)
> 


My bad.  In fact I was doing TEXT TO BLOB($vt_Request;$vx_Request;UTF8 text 
without length)  I missed that when typing it into the email.

We have also tried sending the image as the payload instead of making it JSON 
as well as many other things.

I forgot to mention we are doing the call from v16R5 desktop application to a 
v15.4 server not that that should make a difference but possibly someone knows 
different.

Regards,  Dougie


telekinetix Limited- J. Douglas Cryer
Phone : 01234 761759  Mobile : 07973 675 218
2nd Floor Broadway House, 4-6 The Broadway, Bedford MK40 2TE
Email : jdcr...@telekinetix.com   Web : 
http://www.telekinetix.com 

 

**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: HTTP Body Size

2018-02-08 Thread Douglas Cryer via 4D_Tech
Jeremy,

Thanks.  I have tried setting the headers with various values for Content-Type 
despite the documentation stating that these are defaulted for the different 
data types.  http://doc.4d.com/4Dv15/4D/15.5/HTTP-Request.301-3576985.en.html 


I have not played with Content-Length so that is probably worth a try.  I guess 
I assumed that 4D would be able to figure that out for itself.  What would I 
need to put in Content-Length?  The BLOb or image size depending on what I send?

The strange this is that the send sometimes works but more often it does not 
and still returns a status 200 following an unreachable message.  Every test 
has been using the same small 4k image file.

Regards,  Dougie


> On 8 Feb 2018, at 14:31, Jeremy French  wrote:
> 
> Hi Doug,
> 
> When you use "HTTP Request" command with the "HTTP Post method" constant, I 
> believe you also need to submit request headers.
> 
> In particular, headers such as:
> Content-Length
> Content-Type
> 
> Regards, Jeremy
> 
> 
>> $vl_Status:=HTTP Request(HTTP Post Method;”MYURL”;$vx_Request;$vx_Response)  
>> //Also tried adding various headers
> 



telekinetix Limited- J. Douglas Cryer
Phone : 01234 761759  Mobile : 07973 675 218
2nd Floor Broadway House, 4-6 The Broadway, Bedford MK40 2TE
Email : jdcr...@telekinetix.com   Web : 
http://www.telekinetix.com 

 

**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: HTTP Body Size

2018-02-08 Thread Jeremy French via 4D_Tech
Hi Doug,

When you use "HTTP Request" command with the "HTTP Post method" constant, I 
believe you also need to submit request headers.

In particular, headers such as:
Content-Length
Content-Type

Regards, Jeremy


> $vl_Status:=HTTP Request(HTTP Post Method;”MYURL”;$vx_Request;$vx_Response)  
> //Also tried adding various headers

**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: HTTP Body Size

2018-02-08 Thread Keisuke Miyako via 4D_Tech
I wouldn't do this, it trims the BLOB at 32K unless you specify the UTF8 
constants (see docs).
you might want to consider CONVERT FROM TEXT instead.

> 2018/02/08 17:36、Douglas Cryer via 4D_Tech <4d_tech@lists.4d.com> のメール:
> TEXT TO BLOB($vt_Request;$vx_Request)




**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: HTTP Body Size

2018-02-08 Thread Douglas Cryer via 4D_Tech
Jeremy,

Re:
> Instead of a text variable, you can also use a blob variable to avoid the 
> size limitation.
> 
> http://doc.4d.com/4Dv16R5/4D/16-R5/WEB-GET-HTTP-BODY.301-3481155.en.html 
> 

Yes in fact I am declaring the body variable as a BLOb and passing a BLOb from 
the client.

Roughly speaking here is what I am doing on the client:

C_LONGINT($vl_MyID)
C_PICTURE($vg_Image)
C_BLOB($vx_ImageBlob;$vx_Request)
C_TEXT($vt_ImageB64Text;$vt_Request;$vx_Response)
C_OBJECT($vo_Object)
$vl_MyID:=1
PICTURE TO BLOB($vg_Image;$vx_ImageBlob)
BASE64 ENCODE($vx_ImageBlob;$vt_ImageB64Text)

$vo_Object:=New object
$vo_Object.id :=$vl_MyID
$vo_Object.image:=$vt_ImageB64Text

$vt_Request:=JSON Stringify($vo_Object)
TEXT TO BLOB($vt_Request;$vx_Request)

HTTP AUTEHNTICATE(“TEST”;”TESTPASS”)
$vl_Status:=HTTP Request(HTTP Post Method;”MYURL”;$vx_Request;$vx_Response)  
//Also tried adding various headers
$vt_Response:=BLOB to text($vx_Response;UTF8 text without length)
$vo_Response:=JSON parse($vt_Response;Is object)

I have built dozens of POST methods like this and all have worked till I try to 
put a relatively small BASE64 encoded image into the JSON and the subsequent 
BLOb.  I have also built several rest calls that send out images following a 
GET Request.  The POST just seems to cause the Web Server some major problems.  
It seems to hang the On web authentication part...

I am looking for a way to send the images that works.

Regards,  Dougie


telekinetix Limited- J. Douglas Cryer
Phone : 01234 761759  Mobile : 07973 675 218
2nd Floor Broadway House, 4-6 The Broadway, Bedford MK40 2TE
Email : jdcr...@telekinetix.com   Web : 
http://www.telekinetix.com 

**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: HTTP Body Size

2018-02-07 Thread Jeremy French via 4D_Tech
Hi Doug,

Instead of a text variable, you can also use a blob variable to avoid the size 
limitation.

http://doc.4d.com/4Dv16R5/4D/16-R5/WEB-GET-HTTP-BODY.301-3481155.en.html

Best regards,
Jeremy French

> On Feb 7, 2018, at 4:25 AM, Douglas Cryer via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> under WEB GET HTTP BODY it specifies that the body parameter can receive up 
> to 2GB of text.

**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**