Updated http client
							parent
							
								
									677a1f81ca
								
							
						
					
					
						commit
						17abc90d48
					
				| 
						 | 
				
			
			@ -2,7 +2,8 @@
 | 
			
		|||
! See http://factorcode.org/license.txt for BSD license.
 | 
			
		||||
USING: assocs http kernel math math.parser namespaces sequences
 | 
			
		||||
io io.sockets io.streams.string io.files io.timeouts strings
 | 
			
		||||
splitting calendar continuations accessors vectors io.encodings.binary ;
 | 
			
		||||
splitting calendar continuations accessors vectors io.encodings.latin1
 | 
			
		||||
io.encodings.binary ;
 | 
			
		||||
IN: http.client
 | 
			
		||||
 | 
			
		||||
: parse-url ( url -- resource host port )
 | 
			
		||||
| 
						 | 
				
			
			@ -42,7 +43,7 @@ DEFER: (http-request)
 | 
			
		|||
    ] if ;
 | 
			
		||||
 | 
			
		||||
: (http-request) ( request -- response stream )
 | 
			
		||||
    dup host>> over port>> <inet> <client> stdio set
 | 
			
		||||
    dup host>> over port>> <inet> latin1 <client> stdio set
 | 
			
		||||
    dup "r" set-global  write-request flush read-response
 | 
			
		||||
    do-redirect ;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue