POST command and timeout

Bringing the internet highway into your project? Building FTP, HTTP, email, chat or other client solutions?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Contact:

Re: POST command and timeout

Post by mwieder » Tue May 01, 2012 9:03 pm

It works for me without this line:
Accept: */*
in the full stack the password is protected, anyway this is going to be an app for the iphone, so once the user give username and password the data is stored in a secure way inside he app itself

Yes, but... in the stack you posted here *your* username/password pair is in plain text in a field.

tzenobite
Posts: 57
Joined: Sun Dec 04, 2011 3:59 pm

Re: POST command and timeout

Post by tzenobite » Tue May 01, 2012 9:15 pm

ok, maybe i have to change the password soon :wink:
how many hypercardist are needed to change a light bulb? one to actually do it while at least a dozen more are finding out a slightly different way to do it

proudly hypertalking since 1989

tzenobite
Posts: 57
Joined: Sun Dec 04, 2011 3:59 pm

Re: POST command and timeout

Post by tzenobite » Tue May 01, 2012 10:22 pm

bohhhhhhhhhh
i can't understand...
the stack still get truncated only a few files... actually, both the simple stack i've posted and the full stack get the same file (the one named "alieno 5") truncated at the same word :shock:
the header is the same:

Code: Select all

Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=
Timeout: 50000
Connection: keep-alive
Content-Type: application/xml
maybe the problem is the website and not the stack, but i have to try to get all working in the best way

any idea? there's a way to keep the stack "hearing" to the website until the file is fully downloaded?
i've found the "load" command for GET but i think it doesn't work for the POST
how many hypercardist are needed to change a light bulb? one to actually do it while at least a dozen more are finding out a slightly different way to do it

proudly hypertalking since 1989

tzenobite
Posts: 57
Joined: Sun Dec 04, 2011 3:59 pm

Re: POST command and timeout

Post by tzenobite » Tue May 01, 2012 10:51 pm

it' WEIRD :shock: :shock: :shock:
last news (and then i go to sleep, here the time is 11.47 pm :shock:): i put the truncated text in a field, i mean "truncated" because i scroll the field and i see only a part of the text
but if i "answer" the content of the same field, in the "answer" box the text is full :shock:
so, it's possible that a field shows only some of it contents? isn't it a little bit strange ? :shock:

i'm going to sleep, i'm dead :cry:
how many hypercardist are needed to change a light bulb? one to actually do it while at least a dozen more are finding out a slightly different way to do it

proudly hypertalking since 1989

sturgis
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1685
Joined: Sat Feb 28, 2009 11:49 pm

Re: POST command and timeout

Post by sturgis » Tue May 01, 2012 11:58 pm

Hey, this may be some of the quirkyness of the field. If you "put the number of chars" of your data when its not in the field (IE in the variable that you use with answer) and then "put the number of chars.." of the field, my guess is they will be the same despite what the field is showing.

This would only apply if you have some really long single lines with no line break.

tzenobite wrote:it' WEIRD :shock: :shock: :shock:
last news (and then i go to sleep, here the time is 11.47 pm :shock:): i put the truncated text in a field, i mean "truncated" because i scroll the field and i see only a part of the text
but if i "answer" the content of the same field, in the "answer" box the text is full :shock:
so, it's possible that a field shows only some of it contents? isn't it a little bit strange ? :shock:
your
i'm going to sleep, i'm dead :cry:

sturgis
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1685
Joined: Sat Feb 28, 2009 11:49 pm

Re: POST command and timeout

Post by sturgis » Wed May 02, 2012 3:20 am

Yep, thats it. To see what i'm talking about, select alieno 4. the answer dialog pops up, then field prova is filled with the results that appear incorrect (though there are 13k+ chars in the field you can't see most of them)

in the message box (multi-line) execute the following

repeat with i = 1 to 13
put return after char (i * 1000) of field "prova"
end repeat

Voila' the way too long single line of text that won't display properly is broken into smaller chunks that the field can handle and all the text shows.

There is something about this in one of the dictionary entries but I can't seem to find the right one. The behavior of the field is different with the dontwrap set to true also, but still doesn't work right for this. There are differences in the max char display width, and the max line length of a field but without being able to find those notes in the dictionary again I can't tell you exactly how things work.

bangkok
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 937
Joined: Fri Aug 15, 2008 7:15 am

Re: POST command and timeout

Post by bangkok » Wed May 02, 2012 7:22 am

Here is your stack, with some modifications :

-the proper header in order to receive the data until the end (i've tested it on each book, it's working fine for me)

-a new field that handle UTF8 so you can display special italian characters : é, ô etc.
Attachments
boh27_new.zip
(10.68 KiB) Downloaded 416 times

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Contact:

Re: POST command and timeout

Post by mwieder » Wed May 02, 2012 6:13 pm

bangkok - nicely done. it works for me as well, once I cleaned up the "=" again.

tzenobite
Posts: 57
Joined: Sun Dec 04, 2011 3:59 pm

Re: POST command and timeout

Post by tzenobite » Wed May 02, 2012 10:30 pm

maybe i have found the trick, at least
i've tried another thing: a "repeat" loop where the script bring a word at time and put it and " " after a new, empty variable: it doesn't work, the text is truncated, again
then i tried again: a "replace " " with return" that have to put every word in a new line, but... some lines, even if i see spaces, still was longer than the field
the broken texts contains some strange codes: \u000d, \u000a and \u0009
i tried to clean up these codes simply to not see it, but it seems to work like "tags", once i removed it the text seems to work: the replace " " with return works
i think these codes (\u000d, \u000a and \u0009) works in a strange way and keep the text between it together like a single word :shock:

hope this helps :wink:

edit: the code is unicode :shock: it seems like the authors posted to the website the texts with returns in it and the website's database (with java, i suppose) coded the returns with unicode codes for CR and LF, in fact, if i change " \u000d\u000a" in the whole text i get the page "formatted" or so
:)
how many hypercardist are needed to change a light bulb? one to actually do it while at least a dozen more are finding out a slightly different way to do it

proudly hypertalking since 1989

bangkok
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 937
Joined: Fri Aug 15, 2008 7:15 am

Re: POST command and timeout

Post by bangkok » Thu May 03, 2012 7:21 am

tzenobite wrote:maybe i have found the trick, at least
i've tried another thing: a "repeat" loop where the script bring a word at time and put it and " " after a new, empty variable: it doesn't work, the text is truncated, again)

I'm totally lost. Why do you continue to experience problems with truncated texts ?

With the stack I've sent yesterday, there are no truncated texts.

Have you tried it ?

tzenobite
Posts: 57
Joined: Sun Dec 04, 2011 3:59 pm

Re: POST command and timeout

Post by tzenobite » Thu May 03, 2012 10:41 pm

i tried but these codes still appears... now don't :twisted:
how many hypercardist are needed to change a light bulb? one to actually do it while at least a dozen more are finding out a slightly different way to do it

proudly hypertalking since 1989

Post Reply