Post Data to Web
BlitzMax Forums/BlitzMax Beginners Area/Post Data to Web
| ||
Is there a way to post data to a website with Max without it being URL Variables? I did a search on this site and found a way to do it through url but I'm not sure about form data. Thx RAFF |
| ||
I don't think BlitzMax supports HTTP POST. You can always use HTTP GET tho'. |
| ||
I'm not 100% sure how you would do it in BMax, but you do need to pass the header:multipart/form-data; boundary=--------<Unique Boundary Code> The <Unique Boundary Code> can be generated from the current date for instance. (remove <>) |
| ||
That sucks I would like to submitt an xml file to my website which can be too long to be a url variable. |
| ||
send this to port 80POST /login.php HTTP/1.1 Host: www.mysite.com User-Agent: Mozilla/4.0 Content-Length: 27 Content-Type: application/x-www-form-urlencoded userid=joe&password=guessme to do POSTing as for sending a file, theres a number of methods you can use but you could try application/octet-stream |
| ||
...if you want to get really in-depth on the subject of what to send to an HTTP server (and what to expect in response), check out RFC 2616 -- section 14 may be of particular interest. http://www.faqs.org/rfcs/rfc2616.html |
| ||
Thanks Chris and Tom I'll give that a try, Got some reading to do. |
| ||
Oh boy I can't believe I didn't see this http://www.blitzmax.com/codearcs/codearcs.php?code=1579 Hopefully it works |
| ||
LOL never underestimate the power of blitzmax.com Luke CUT that was THE DARKSIDE Luke, Luke use the SOURCE (code) |
| ||
HAHA and it worked Thx all |
| ||
That is really good. Thansk. |
| ||
how about saving/attaching a cookie to a web-post? can it be done? and if so: how? ghislain |
| ||
run that code from that link I posted. If you look at the return if you hit a page that has a cookie it will have a field in there that says set cookie. Just parse that data and store it in a variable. Now to hit another page, you are going to have to modify the code to reinsert those set cookie fields with the ones saved on the variable. Try that out it should work. -RAFF |
| ||
All a cookie is is client-side information storage. Save whatever "cookie" info you want in an ordinary preferences file. |
| ||
I've got a question, can you use HTTPS with the above code/other post? What encrypts and decrypts my data? |