Data Update

This commit is contained in:
Ingy döt Net 2023-07-09 17:42:30 -04:00
parent 015c2add84
commit e50b5c3114
206 changed files with 6337 additions and 523 deletions

View file

@ -0,0 +1,25 @@
include "NSLog.incl"
#plist NSAppTransportSecurity @{NSAllowsArbitraryLoads:YES}
local fn URLSessionHandler( session as URLSessionRef, dta as CFDataRef, response as URLResponseRef, err as ErrorRef, userData as ptr )
if ( fn HTTPURLResponseStatusCode( (HTTPURLResponseRef)response ) == 200 )
NSLog( @"%@", fn StringWithData( dta, NSUTF8StringEncoding ) )
else
NSLog( @"%@", fn ErrorLocalizedDescription( err ) )
end if
NSLogScrollToTop
end fn
local fn URLSessionWithGetRequest( path as CFStringRef )
CFURLRef url = fn URLWithString( path )
MutableURLRequestRef urlRequest = fn MutableURLRequestWithURL( url )
MutableURLRequestSetHTTPMethod( urlRequest, @"HTTP" )
URLSessionRef session = fn URLSessionSharedSession
URLSessionDataTaskRef task = fn URLSessionDataTaskWithRequestCompletionHandler( session, urlRequest, @fn URLSessionHandler, NULL )
URLSessionTaskResume( task )
end fn
fn URLSessionWithGetRequest( @"http://rosettacode.org" )
HandleEvents