> On Aug 24, 2016, at 4:36 AM, Normal Loone <andreas.m.wi...@gmx.de> wrote:
> 
> Sorry, I should have been clearer:
> 
> I want to send a file directly from DrRacket to a server. I have submit 
> button as a plugin in DrRacket and it then should take the file and send it 
> to the server (the file is known, doesnt need to be selected from user).
> 
> I tried the code from HTH Stephen, but problem is that the web application 
> starts on DrRacket start and not when I press the button, how I wanted it.
> 
> So if someone could tell me a way to just directly send a file with DrRacket 
> as an HTML request, I'd really appreciate that.

Yes, this is a one-liner:

#lang racket

(require net/http-client)

(http-sendrecv #"example.com"
               #"/"
               #:method "POST"
               #:data "MY FAVORITE BYTES”)

This will send a POST request to example.com, with path /, and attach the bytes 
#”MY FAVORITE BYTES”.

John Clements


-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Attachment: signature.asc
Description: PGP signature

Reply via email to