Re: HTTPSocket

2007-04-13 Thread Carlo Rubini
>On 4/12/07, Carlo Rubini <[EMAIL PROTECTED]> wrote: > > Does anybody have the necessary code to ping a site? > >"Dennis Birch" <[EMAIL PROTECTED]> wrote: >Somebody released a set of ICMP classes, which is what's required for >pinging. I'd search the archives for ICMP and see if it shows up. Than

Re: HTTPSocket

2007-04-13 Thread jis
Some sites need: http.SetRequestHeader ("Host", "yoursite.com") http.SetRequestHeader ("Connection", "keep-alive") http.SetRequestHeader ("User-Agent", "Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/125.5.7 (KHTML, like Gecko) Safari/125.12") http.SetRequestHeader ("Accept", "*/*") ht

Re: HTTPSocket

2007-04-12 Thread Dennis Birch
On 4/12/07, Carlo Rubini <[EMAIL PROTECTED]> wrote: > Does anybody have the necessary code to ping a site? Somebody released a set of ICMP classes, which is what's required for pinging. I'd search the archives for ICMP and see if it shows up. ___ Unsubs

Re: HTTPSocket

2007-04-12 Thread Carlo Rubini
I too follow the same procedure with this variation: if the socket connects I close the socket and return true, while if I get a 103 error I return false. And the socket is an object dragged in the window. But I was thinking whether it would not be better pinging a site. Does anybody have the

Re: HTTPSocket

2007-04-11 Thread jis
Sub ConnectionAvailable()As String dim http as new HTTPSocket http.yield = true dim temp as String = http.get("http://www.yoursite.com";, 5) if len(temp) > 0 then return temp else // No connection end if Johan Simons On 11/04/20

Re: HTTPSocket timeout

2006-12-10 Thread Aude FRONT
Dennis Birch a écrit : The LR says HTTPSocket.Get takes an optional timeout parameter. When I try to use it in code I get a compile-time error that "This method requires fewer parameters than were passed." Is the LR wrong or am I doing something wrong?

Re: HttpSocket and cpu usage

2006-11-19 Thread Fargo Holiday
Ok... so... If I do it the way listed below, everything is cool. If, however, I'm waiting for a result, then it goes back to the way it was before. So, it seems that it has nothing to do with waiting for a string, but rather the result in general. So this: dim h as new HTTPSocket dim da

Re: HttpSocket and cpu usage

2006-11-19 Thread Mark Lubratt
Immutable strings.(?) Mark On Nov 19, 2006, at 1:48 PM, Fargo Holiday wrote: Solved it! I was thinking to myself how odd it was to try and save that data to a string. So, I added this to a button: dim h as new HTTPSocket dim data as FolderItem data = GetFolderItem("downer.rar") h.get("

Re: HttpSocket and cpu usage

2006-11-19 Thread Fargo Holiday
Solved it! I was thinking to myself how odd it was to try and save that data to a string. So, I added this to a button: dim h as new HTTPSocket dim data as FolderItem data = GetFolderItem("downer.rar") h.get("http://www.rpgportland.com/software/sounds.rar";, data) Lo! Barely a blip in CP

Re: HttpSocket and cpu usage

2006-11-19 Thread Tomas Camin
Well at least I'm not alone. I tried in different ways, but I'm always getting way too high cpu loads. Tomas Howdy, On my XP box, I ran your code to download a file from my website, and it would grab up to whatever CPU power was available. I put it in a thread and that kept it running

Re: HttpSocket and cpu usage

2006-11-19 Thread Fargo Holiday
Howdy, On my XP box, I ran your code to download a file from my website, and it would grab up to whatever CPU power was available. I put it in a thread and that kept it running between 34 and 40% of the CPU load. Should a single call to http get do that? I have no real idea. Mostly I wanted to

Re: httpsocket post encoding

2006-10-29 Thread Mark Nutter
--- Tommy <[EMAIL PROTECTED]> wrote: > Hi, > > I'm trying to send some data previously converted to utf-8 to a > > server using a post method. > > Basically this is what I'm doing: > > socket1.SetRequestHeader("Content-type","charset=UTF-8") > result=socket1.post(url,Audioscrobble

Re: HTTPSocket troubles - SOLVED

2006-09-12 Thread Mark Lubratt
The problem I was having was actually orthogonal to this. Thanks! Mark On Sep 12, 2006, at 9:52 AM, Mark Lubratt wrote: Hello! I'm trying to use HTTPSocket to send a filled out form to my accounting system (SQL-Ledger). I construct a dictionary with all the proper parameters (params) and

Re: HTTPSocket DownloadComplete

2006-08-17 Thread andrew
Ah! There's the problem - I wasn't using HTTPSocket.Get correctly. Passing a folderitem for saving data to makes the DownloadComplete event fire when the download is done. The correct usage for my application is: HTTPSocket.Get(Address, Folderitem) I really do hate small errors... two

Re: HTTPSocket DownloadComplete

2006-08-17 Thread Phil M
On Aug 17, 2006, at 12:52 PM, [EMAIL PROTECTED] wrote: Upon clicking my command button, which sets Yield to True and uses the Get method to download, I got this order of events firing: That is the problem... you are using "Yield". HTTPSocket has two methods to get files... one using Events

Re: HTTPSocket DownloadComplete

2006-08-17 Thread andrew
Okay, i've finished rewriting the whole, thing, and to my surprise, I have exactly the same problem. I'm compiling from RB2005r4 for OSX. The problem occurs on every platform for any download. The DownloadComplete event simply isn't firing. Then, to be absolutely sure, I made it as simpl

Re: HTTPSocket DownloadComplete

2006-08-16 Thread andrew
On Windows, using 2005r4, the DownloadComplete event fires once a file is downloaded. Normally, I can get it to work, too. This is the first time I've had trouble. I am convinced that this is a code problem - I just can't find the problem... Andrew Keller ___

RE: HTTPSocket DownloadComplete

2006-08-16 Thread Carlos M
On Aug 16, 2006 6:38 PM, [EMAIL PROTECTED] wrote: > I'm using REALbasic 2005r4 on OSX, and the problem occurs on all > platforms using any server and any download. It doesn't matter > whether the application is a debug app or not. On Windows, using 2005r4, the DownloadComplete event fires once a

Re: HTTPSocket DownloadComplete

2006-08-16 Thread andrew
Well, given that it only took a day to write this code in the first place, I'm going to try writing it again, and then I'll see what's different. While I'm at it... Is the DownloadComplete event guaranteed to fire, even if there's an error? Would the error Error event fire before the Do

Re: HTTPSocket DownloadComplete

2006-08-16 Thread andrew
I'm using REALbasic 2005r4 on OSX, and the problem occurs on all platforms using any server and any download. It doesn't matter whether the application is a debug app or not. Andrew Keller On Aug 16, 2006, at 11:30 AM, John Balestrieri wrote: What platform are you running? Does it happen w

Re: HTTPSocket DownloadComplete

2006-08-16 Thread John Balestrieri
What platform are you running? Does it happen with files from a particular server, what about files downloaded from another server? Does changing the download location change anything, depending on which server you are downloading from? Maybe it's permissions issue if you are running on OS

Re: HTTPSocket DownloadComplete

2006-08-16 Thread andrew
I've got a weird problem with my HTTPSocket. First of all, this all worked just fine before I changed things, but now, it seems like the DownloadComplete event isn't firing. The application just sits there hogging processor time, not writing to the hard drive, not using any extra memory,

Re: HTTPSocket Encodings

2006-08-04 Thread GregO
On Aug 4, 2006, at 10:06 am, [EMAIL PROTECTED] wrote: On Aug 04, 2006, at 13:42 UTC, GregO wrote: Thank you everyone that replied. Yes indeed, I was using the wrong encoding for the downloaded text (It should have been ISOLatin1). Last dumb question. How do I write this string in a BinaryStr

Re: HTTPSocket Encodings

2006-08-04 Thread joe
On Aug 04, 2006, at 13:42 UTC, GregO wrote: > Thank you everyone that replied. Yes indeed, I was using the wrong > encoding for the downloaded text (It should have been ISOLatin1). > > Last dumb question. How do I write this string in a BinaryStream and > have it retain it's encoding. To be p

Re: HTTPSocket Encodings

2006-08-04 Thread GregO
Thank you everyone that replied. Yes indeed, I was using the wrong encoding for the downloaded text (It should have been ISOLatin1). Last dumb question. How do I write this string in a BinaryStream and have it retain it's encoding. To be perfectly honest, I'm writing to a custom Lingua file

Re: HTTPSocket Encodings

2006-08-04 Thread Sven E Olsson
On 2006-08-04, at 2:45 PM, GregO wrote: You know, I didn't even try it under Windoze... in my environment, the app will probably never run on anything but OS X. I'll see what I get. But on Mac OS X, the text is definitely nil encoded. I'll let you know how the PC version goes. Greg But

Re: HTTPSocket Encodings

2006-08-04 Thread GregO
Ok, so what's the RB equivalent of ISO-8859-1 encoding? Greg On Aug 3, 2006, at 6:38 pm, Walter Purvis wrote: I don't get an empty string when I run your code using 2006r3 on XP. It doesn't make sense that you would get an empty string -- it's either a weird bug or you had some other unacc

Re: HTTPSocket Encodings

2006-08-04 Thread Mark Nutter
--- GregO <[EMAIL PROTECTED]> wrote: > You know, I didn't even try it under Windoze... in my > environment, > the app will probably never run on anything but OS X. I'll see > what I > get. But on Mac OS X, the text is definitely nil encoded. I'll > let > you know how the PC version goes.

Re: HTTPSocket Encodings

2006-08-04 Thread GregO
You know, I didn't even try it under Windoze... in my environment, the app will probably never run on anything but OS X. I'll see what I get. But on Mac OS X, the text is definitely nil encoded. I'll let you know how the PC version goes. Greg On Aug 3, 2006, at 6:38 pm, Walter Purvis wrote

Re: HTTPSocket Encodings

2006-08-03 Thread joe
On Aug 03, 2006, at 20:59 UTC, GregO wrote: > str = h.Post("http://babelfish.altavista.com/babelfish/tr",30) > str = DefineEncoding(s,encodings.UTF8) > str = ConvertEncoding(s,encodings.MacRoman) > > str is empty after the conversion. What is "s" here? You didn't show us where th

RE: Re: HTTPSocket Encodings

2006-08-03 Thread Walter Purvis
I don't get an empty string when I run your code using 2006r3 on XP. It doesn't make sense that you would get an empty string -- it's either a weird bug or you had some other unaccounted for problem. As Mars said, though, the text is being returned to you as text/html with ISO-8859-1 encoding. _

Re: Re: HTTPSocket Encodings

2006-08-03 Thread Dennis Birch
Didn't you say in your first message in this thread that the string you're getting back from the HTTP socket is nil-encoded? If so, why are you defining it as UTF-8? On 8/3/06, GregO <[EMAIL PROTECTED]> wrote: Yup. Doin too many things at once. Try it like this... (they were originally just "s"

Re: HTTPSocket Encodings

2006-08-03 Thread GregO
On Aug 3, 2006, at 5:07 pm, Deane Venske wrote: Hi There, str = h.Post("http://babelfish.altavista.com/babelfish/tr",30) str = DefineEncoding(s,encodings.UTF8) str = ConvertEncoding(s,encodings.MacRoman) str is empty after the conversion. Shouldn't the "s" above in DefineEncod

Re: HTTPSocket Encodings

2006-08-03 Thread Deane Venske
Hi There, str = h.Post("http://babelfish.altavista.com/babelfish/tr",30) str = DefineEncoding(s,encodings.UTF8) str = ConvertEncoding(s,encodings.MacRoman) str is empty after the conversion. Shouldn't the "s" above in DefineEncoding and ConvertEncoding be "str"? Regards, Deane

Re: HTTPSocket Encodings

2006-08-03 Thread GregO
On Aug 3, 2006, at 4:17 pm, Mars Saxman wrote: On Aug 3, 2006, at 1:12 PM, GregO wrote: Can anyone tell me why converting the text of an editfield containing diacriticals (which starts as UTF8) to MacRoman works just fine, but converting a nil encoded string which contains a few diacriti

Re: HTTPSocket Encodings

2006-08-03 Thread Mars Saxman
On Aug 3, 2006, at 1:12 PM, GregO wrote: Can anyone tell me why converting the text of an editfield containing diacriticals (which starts as UTF8) to MacRoman works just fine, but converting a nil encoded string which contains a few diacriticals (which is what I'm getting back from HTTPSoc

Re: HTTPSocket problems

2006-07-03 Thread Harrie Westphal
On Jul 3, 2006, at 4:05 PM, Craig Hoyt wrote: This should be in the LR? From the Language Reference manual: "If a FolderItem is passed, the data will be downloaded to that file. The DownloadComplete event will execute when the response data has been retrieved." Notice that is says it w

Re: HTTPSocket problems

2006-07-03 Thread Craig Hoyt
Let me answer my own question. I finely found what error 1 is. I searched the LR several times last night and came up empty but this morning I found the reference. This lead me to a solution. Error 1 is unable to make a file, so I define my folderitem as f=DeskTopFolder.Child(dlName). Where

Re: HTTPSocket problems

2006-07-03 Thread Tim Murphy
Folder item? Why not just download the file the way the rb example does, Make a TCP socket. Set it to httpsocket. Call it with: socket1.get("http://mydomain/Updates/myfile";) Then in the socket1 PageReceived event, you can access the entire download to compare against your current version:

Re: HTTPSocket problems

2006-07-03 Thread Sven E Olsson
On 2006-07-03, at 7:27 PM, Scott Wagner wrote: The error 1 usually means the socket is busy. Try using a different. socket. Like this. have 2 http sockets if the update is needed then use the second one. and instead of a text file use a header. this way its all backend it will move faster.

Re: HTTPSocket problems

2006-07-03 Thread Peter Truskier
The Language Reference says: If a FolderItem is passed, the data will be downloaded to that file. I think that means it's expecting a folder item which is a *file* rather than a folder as in your code. I would try something like this: f = DesktopFolder.child("myfile") Does that work?

Re: HTTPSocket problems

2006-07-03 Thread Scott Wagner
The error 1 usually means the socket is busy. Try using a different. socket. Like this. have 2 http sockets if the update is needed then use the second one. and instead of a text file use a header. this way its all backend it will move faster. so error 1 was socket is busy. create a new one

Re: HTTPSocket, POST and timeout...

2006-06-02 Thread Mark Nutter
--- Daniel Chiaramello <[EMAIL PROTECTED]> wrote: > Hi all. > > Well, I have a problem with the Post method of HTTPSocket and > setting a > timeout. > > In documentation, the syntax is the following one: > HTTPSocket.Post URL, [File], [Timeout] The docs are confusingly inaccurate here. Ther

Re: HTTPSocket, POST and timeout...

2006-06-02 Thread Peter Truskier
uires fewer parameters than were passed." That's my problem :) - Original Message - From: "Giles Williams" <[EMAIL PROTECTED]> To: "REALbasic NUG" Sent: Friday, June 02, 2006 6:07 PM Subject: Re: HTTPSocket, POST and timeout... You just type it

Re: HTTPSocket, POST and timeout...

2006-06-02 Thread Daniel Chiaramello
Your simple sample does not compile (RB2006r2): "This method requires fewer parameters than were passed." That's my problem :) - Original Message - From: "Giles Williams" <[EMAIL PROTECTED]> To: "REALbasic NUG" Sent: Friday, June 02, 2006

Re: HTTPSocket, POST and timeout...

2006-06-02 Thread Giles Williams
You just type it exactly as the Documentation shows it. EG: Dim ht As New HTTPSocket ht.Post( "http://www.yoururl.com/";, 6000 ) That posts the file "http://www.yoururl.com/"; with a time out of 6 seconds. On 2 Jun 2006, at 16:51, Daniel Chiaramello wrote: Hi all. Well, I have a

RE: HTTPSocket GetHeaders NOT Timing Out

2006-05-13 Thread Carlos M
I filled a bug report for this problem, as I think this is a bug: http://snipurl.com/smhvwxde Carlos On May 13, 2006 6:17 PM, Carlos M wrote: > RB2006r2 on Windows 2000 > > When using: > Dim theHeaders As InternetHeaders > Dim theSocket As New HTTPSocket > Dim theURL As String = "http://ww

Re: HTTPSocket Authentication

2006-04-09 Thread Steve Garman
name = "MyName" password = "MyPassword" Return True Sorry, missed the last line somehow. -- Steve Garman Using REALbasic 2006r1 Professional on Windows XP Pro ___ Unsubscribe or switch delivery mode:

Re: HTTPSocket Authentication

2006-04-09 Thread Steve Garman
In a message regarding HTTPSocket Authentication dated Sun, 9 Apr 2006 01:08:21 -0500, Stephen Koger said that ... > Does anyone out there have a working example of using the > AuthenticationRequired Event when trying to access a HTTP site requiring a > username and password? name = "MyName"

Re: HTTPSocket file downloading

2006-02-24 Thread jda
Use the HTTPSocket events to your advantage. You are trying to force a "Yield = False" while still taking advantage of the events. I don't know why the HTTPSocket events are not firing unless the "While...Wend" structure does not yield to BackgroundTasks like the "For...Loop". Thanks for y

Re: HTTPsocket

2006-02-23 Thread Robert Carroll
Mount_webdav works for me when I run it from the terminal, but fails with error 512 when the same code is run from a shell in RB 5.5.5. In both cases, I am just attempting to mount my own idisk: mount_webdav http://idisk.mac.com/membername/ /Volumes/Mntpnt/ Rob Message: 14 Subject: Re

Re: HTTPSocket file downloading

2006-02-23 Thread Phil M
On Feb 23, 2006, at 2:04 PM, jda wrote: I want to download a file with an HTTPSocket. While it's downloading I put up a dialog with a progress bar. When the download is finished the dialog is dismissed. To do this, I have created a thread that issues a .get command via an HTTPSocket. The

Re: HTTPsocket

2006-02-23 Thread Stefan Pantke
Am 23.02.2006 um 16:37 schrieb Robert Carroll: HI, Is it possible to write a file to a .mac web space with the httpsocket post command? I would prefer to be able to access a file in my "sites" directory, but could set up something in the "public" folder if necessary. Since .mac provides

Re: httpsocket FileTypes

2006-02-13 Thread Navdeep Bains
Hello, The Finder is probably just being a little sluggish in recognizing the change and updating the icons accordingly. If you double-click on one of the files, does it open in iTunes or BBEdit? Also, changing the type/creator to "" should work as an alternative to nulling them out.

Re: httpsocket FileTypes

2006-02-13 Thread Tony Spencer
Well sometimes icon changes don't occur until the desktop is rebuilt... On 14 Feb 2006, at 01:21, Joseph J. Strout wrote: At 11:18 AM +1100 2/14/06, Jeff Ayling wrote: Then I tried: file.MacType=ChrB(0)+ChrB(0)+ChrB(0)+ChrB(0) file.MacCreator=ChrB(0)+ChrB(0)+ChrB(0)+ChrB(0) and now

Re: httpsocket FileTypes

2006-02-13 Thread Jeff Ayling
On 14/02/2006, at 11:21 AM, Joseph J. Strout wrote: At 11:18 AM +1100 2/14/06, Jeff Ayling wrote: Then I tried: file.MacType=ChrB(0)+ChrB(0)+ChrB(0)+ChrB(0) file.MacCreator=ChrB(0)+ChrB(0)+ChrB(0)+ChrB(0) and now they don't have Type or Creator codes but they still have the bbedit

Re: httpsocket FileTypes

2006-02-13 Thread Will Leshner
On 2/13/06, Jeff Ayling <[EMAIL PROTECTED]> wrote: > but there are many different formats and I didn't > really want to have to add them all to every downloadcomplete event. If all else fails, you can always handle dumping the data to disk yourself. Then you should have complete control over the

Re: httpsocket FileTypes

2006-02-13 Thread Joseph J. Strout
At 11:18 AM +1100 2/14/06, Jeff Ayling wrote: Then I tried: file.MacType=ChrB(0)+ChrB(0)+ChrB(0)+ChrB(0) file.MacCreator=ChrB(0)+ChrB(0)+ChrB(0)+ChrB(0) and now they don't have Type or Creator codes but they still have the bbedit icons. I'm not sure what to make of this. The Finder

Re: httpsocket FileTypes

2006-02-13 Thread Jeff Ayling
On 14/02/2006, at 11:06 AM, Will Leshner wrote: On 2/13/06, Jeff Ayling <[EMAIL PROTECTED]> wrote: ok, I had a look with a filetype editor and the files have type: TEXT and Creator: R*ch - but I'm not setting those - these files are being downloaded with the httpsocket and the server is sendi

Re: httpsocket FileTypes

2006-02-13 Thread Will Leshner
On 2/13/06, Jeff Ayling <[EMAIL PROTECTED]> wrote: > ok, I had a look with a filetype editor and the files have type: TEXT > and Creator: R*ch - but I'm not setting those - these files are being > downloaded with the httpsocket and the server is sending the correct > audio/mp3 tags so I'm not sure

Re: httpsocket FileTypes

2006-02-13 Thread Joseph J. Strout
At 10:39 AM +1100 2/14/06, Jeff Ayling wrote: ok, I had a look with a filetype editor and the files have type: TEXT and Creator: R*ch - but I'm not setting those - these files are being downloaded with the httpsocket and the server is sending the correct audio/mp3 tags so I'm not sure why RB i

Re: httpsocket FileTypes

2006-02-13 Thread Jeff Ayling
On 14/02/2006, at 10:14 AM, Joseph J. Strout wrote: At 10:06 AM +1100 2/14/06, Jeff Ayling wrote: My files are being downloaded with either bbedit or text edit icons - they have the correct .mp3, .mp4 or .jpg extensions. Have a look at them with a file type editor (or just get a FolderIt

Re: httpsocket FileTypes

2006-02-13 Thread Joseph J. Strout
At 10:06 AM +1100 2/14/06, Jeff Ayling wrote: My files are being downloaded with either bbedit or text edit icons - they have the correct .mp3, .mp4 or .jpg extensions. Have a look at them with a file type editor (or just get a FolderItem to them, and print out the MacType). Do they have a t

Re: httpsocket FileTypes

2006-02-13 Thread Jeff Ayling
On 14/02/2006, at 9:48 AM, Joseph J. Strout wrote: At 9:42 AM +1100 2/14/06, Jeff Ayling wrote: If I'm using an httpsocket to download a file - what is the best way to be sure that the file will be downloaded with the correct creator,type, icon etc? For Classic MacOS, you'd want to talk

Re: httpsocket FileTypes

2006-02-13 Thread Joseph J. Strout
At 9:42 AM +1100 2/14/06, Jeff Ayling wrote: If I'm using an httpsocket to download a file - what is the best way to be sure that the file will be downloaded with the correct creator,type, icon etc? For Classic MacOS, you'd want to talk to Internet Config (a third-party extension that then g