HTTP Library (Crossplatform, GET/HEAD/POST, chunked, gzip)
Re: HTTP Library (Crossplatform, GET/HEAD/POST, chunked, gzi
DarkPlayer
Thank you for the response, I read it about 6-7 hours ago, I have spent the best part of that time reading and making attempts to get something to work
Time for a coffee & clear my head a bit, haven't given up yet, more I can try some of my attempts have been close, lol
So I've made this post in the hope that maybe someone with more experience can make some use of my observations so far and give me a boost in the right direction ??
I really would like everything to be in the one exe.
Thanks
[SOLVED]
Thank you for the response, I read it about 6-7 hours ago, I have spent the best part of that time reading and making attempts to get something to work
Time for a coffee & clear my head a bit, haven't given up yet, more I can try some of my attempts have been close, lol
So I've made this post in the hope that maybe someone with more experience can make some use of my observations so far and give me a boost in the right direction ??
I really would like everything to be in the one exe.
Thanks
[SOLVED]
Last edited by Oxyandy on Thu Jul 04, 2013 6:05 pm, edited 2 times in total.
[url]irc://freenode/purebasic[/url]
Re: HTTP Library (Crossplatform, GET/HEAD/POST, chunked, gzi
Compared to 4. (as in last post) with WireShark I got this from Curl
Nice shows me "press" with 2 #CRLF$ before
Upload files
More to work with, going to try now
Code: Select all
POST /upload/in HTTP/1.1
User-Agent: Curl
Host: mysite
Accept: */*
Content-Type: multipart/form-data; boundary=----------------------------b87ebc3d2679
------------------------------b87ebc3d2679
Content-Disposition: form-data; name="fileupload1"; filename="Filename.zip"
Content-Type: application/octet-stream
<data of file snipped from here>
------------------------------b87ebc3d2679
Content-Disposition: form-data; name="press"
Upload files
------------------------------b87ebc3d2679--
Upload files
More to work with, going to try now
Last edited by Oxyandy on Thu Jul 04, 2013 6:06 pm, edited 1 time in total.
[url]irc://freenode/purebasic[/url]
Re: HTTP Library (Crossplatform, GET/HEAD/POST, chunked, gzi
Well I know there are no good posts about PB and Uploading files,
but let me assure anyone, it does work, and works very well !!
Even with Binary files of course !
Dont give up, and use WireShark it will show you what you are doing wrong !
I don't use the libs posted in this thread, but I really respect the detail..
Thanks for sharing to the community
but let me assure anyone, it does work, and works very well !!
Even with Binary files of course !
Dont give up, and use WireShark it will show you what you are doing wrong !
I don't use the libs posted in this thread, but I really respect the detail..
Thanks for sharing to the community
[url]irc://freenode/purebasic[/url]
-
- Enthusiast
- Posts: 429
- Joined: Sun Apr 06, 2008 12:54 pm
- Location: Brisbane, Qld, Australia
- Contact:
Re: HTTP Library (Crossplatform, GET/HEAD/POST, chunked, gzi
Many thanks for this library, DarkPlayer. It's just what I need for communicating with vMix as mentioned here.
Re: HTTP Library (Crossplatform, GET/HEAD/POST, chunked, gzi
First of all: Thank you for this Library !
EDIT/SOLVED: Sometimes writing things down is all you need to do to spot the problem.
There were some forbidden characters (":") in the filename.
I am quite new to PureBasic, I have some experience with VBA, SQL & Java though.
As an excercise I am writing a little Podcast downloader.
So far it works fine, it reads a config XML file, where the urls of the podcast feeds are stored.
Then it downloads the xml/rss file of the podcast, and reads the propertys of the items/episodes.
The plan was/is to download the single mp3 using the urls from the feed.
But somehow this doesnt't always work, the download progresses as planned, but in
the end there is nothing but a 0 kb file without an extension.
This results in a 0 kb file "J:\PodcastTest\hr-iNFO Wissenswert\Meilensteine der Popmusik - Talking Heads: Psycho Killer (1977)"
Here is my basic code:
It works fine with other podcasts though.
Any idea/diagnosis on what may be the problem there ?
Best regards
Sebert
EDIT/SOLVED: Sometimes writing things down is all you need to do to spot the problem.
There were some forbidden characters (":") in the filename.
I am quite new to PureBasic, I have some experience with VBA, SQL & Java though.
As an excercise I am writing a little Podcast downloader.
So far it works fine, it reads a config XML file, where the urls of the podcast feeds are stored.
Then it downloads the xml/rss file of the podcast, and reads the propertys of the items/episodes.
The plan was/is to download the single mp3 using the urls from the feed.
But somehow this doesnt't always work, the download progresses as planned, but in
the end there is nothing but a 0 kb file without an extension.
Code: Select all
Downloading to file 'J:\PodcastTest\hr-iNFO Wissenswert\Meilensteine der Popmusik - Talking Heads: Psycho Killer (1977).mp3'
Progress: 0.0000000000
Progress: 0.0752758682
Progress: 0.1505517364
Progress: 0.2258276045
Progress: 0.3011034727
Progress: 0.3763793409
Progress: 0.4516552091
Progress: 0.5269311070
Progress: 0.6022069454
Progress: 0.6774828434
Progress: 0.7527586818
Progress: 0.8280345798
Progress: 0.9033104181
Progress: 0.9785863161
Here is my basic code:
Code: Select all
XIncludeFile "disconnect.pbi" ;Must be in front of all HTTP Query Includes!!
XIncludeFile "http.pbi"
InitNetwork()
Define overwrite
Define.s EntryUrl,Ordner
EntryUrl = "http://mp3.podcast.hr-online.de/mp3/podcast/hr2_wissenswert/hr2_wissenswert_20140322_3.mp3"
Ordner = "J:\PodcastTest\hr-iNFO Wissenswert\Meilensteine der Popmusik - Talking Heads: Psycho Killer (1977).mp3"
SimpleHTTP_GET_File(EntryUrl, Ordner, overwrite.i = #True)
Any idea/diagnosis on what may be the problem there ?
Best regards
Sebert
Re: HTTP Library (Crossplatform, GET/HEAD/POST, chunked, gzi
Hi,
another question: I get "The connection aborted/timed out during the transfer!" for some files which download
just fine via browser or ReceiveHTTPFile. Is there a way to give the "SimpleHTTP_GET_File" Procedure a bit more
time to download?
Regards
Sebastian
another question: I get "The connection aborted/timed out during the transfer!" for some files which download
just fine via browser or ReceiveHTTPFile. Is there a way to give the "SimpleHTTP_GET_File" Procedure a bit more
time to download?
Regards
Sebastian
Re: HTTP Library (Crossplatform, GET/HEAD/POST, chunked, gzi
Thanks for this excellent lib! Works great
I had to do minor modifications (e.g Content-Type allowing for application/json to pass ...) and it worked fine where cURL failed!
Hopefully the PB team will take your notes into consideration when developing a native HTTP (i said hopefully ... soon )
Thanks again
I had to do minor modifications (e.g Content-Type allowing for application/json to pass ...) and it worked fine where cURL failed!
Hopefully the PB team will take your notes into consideration when developing a native HTTP (i said hopefully ... soon )
Thanks again
Re: HTTP Library (Crossplatform, GET/HEAD/POST, chunked, gzi
i'm still lost about how to upload file ( for example a text/ jpg / zip file ) using SimpleHTTP_POST_RAW and SimpleHTTP_POST
would you please show me a complete example from html -> php -> pb, please
i tried using this, but failed :
Update /
i've been successfuly post text file / string
maybe i'll encrypt the content before POST it so it will be text friendly and decompress it online.
Thank you very much
would you please show me a complete example from html -> php -> pb, please
i tried using this, but failed :
Update /
i've been successfuly post text file / string
maybe i'll encrypt the content before POST it so it will be text friendly and decompress it online.
Thank you very much
Re: HTTP Library (Crossplatform, GET/HEAD/POST, chunked, gzi
does any one have a working example of SimpleHTTP_POST_RAW from this library?
[edited to delete my not working example]
Thank you.
Norm.
[edited to delete my not working example]
Thank you.
Norm.
Last edited by normeus on Mon Mar 23, 2015 8:48 pm, edited 1 time in total.
Re: HTTP Library (Crossplatform, GET/HEAD/POST, chunked, gzi
Hi,
without checking in real:
If you send a file, you need "Content-length:" in the header.
Or you use chunks, but then you need "Transfer-Encoding: chunked".
Maybe you need also to tell the server tahtyou send it Base64 encoded.
But I would send it as binary, because it is much faster (shorter).
Bernd
without checking in real:
If you send a file, you need "Content-length:" in the header.
Or you use chunks, but then you need "Transfer-Encoding: chunked".
Maybe you need also to tell the server tahtyou send it Base64 encoded.
But I would send it as binary, because it is much faster (shorter).
Bernd
Re: HTTP Library (Crossplatform, GET/HEAD/POST, chunked, gzi
Anyone who can make it support https? Thanks a lot.
Re: HTTP Library (Crossplatform, GET/HEAD/POST, chunked, gzi
That would be quite a lot of work, I don't think anyone has this kind of free time.Aming wrote:Anyone who can make it support https? Thanks a lot.
Re: HTTP Library (Crossplatform, GET/HEAD/POST, chunked, gzi
infratec posted this link for HTTPS and it has worked for me ( to post/request data from googlemaps)
http://www.purebasic.fr/english/viewtop ... 13&t=58824
Norm.
http://www.purebasic.fr/english/viewtop ... 13&t=58824
Norm.
google Translate;Makes my jokes fall flat- Fait mes blagues tombent à plat- Machte meine Witze verpuffen- Eh cumpari ci vo sunari
Re: HTTP Library (Crossplatform, GET/HEAD/POST, chunked, gzi
It needs all fingerprint functions updated and you can now implement SSL/TLS fallback for GET using PB functions.
EDIT: Some sites/servers use multiple Set-Cookie headers even though I believe this is against spec.. Index parameter for request header function?
EDIT: Some sites/servers use multiple Set-Cookie headers even though I believe this is against spec.. Index parameter for request header function?
The truth hurts.