Example #1
0
        public static unsafe NSData SendSynchronousRequest(NSUrlRequest request, out NSUrlResponse response, out NSError error)
        {
            IntPtr responseStorage = IntPtr.Zero;
            IntPtr errorStorage = IntPtr.Zero;

            void *resp = &responseStorage;
            void *errp = &errorStorage;
            IntPtr rhandle = (IntPtr) resp;
            IntPtr ehandle = (IntPtr) errp;

            var res = Messaging.IntPtr_objc_msgSend_IntPtr_IntPtr_IntPtr (
                class_ptr,
                Selector.GetHandle (selSendSynchronousRequestReturningResponseError),
                request.Handle,
                rhandle,
                ehandle);

            if (responseStorage != IntPtr.Zero)
                response = (NSUrlResponse) Runtime.GetNSObject (responseStorage);
            else
                response = null;

            if (errorStorage != IntPtr.Zero)
                error = (NSError) Runtime.GetNSObject (errorStorage);
            else
                error = null;

            return (NSData) Runtime.GetNSObject (res);
        }
Example #2
0
 public override NSUrlSessionDownloadTask CreateDownloadTask(NSUrlRequest request, NSUrlDownloadSessionResponse completionHandler)
 {
     throw new NotSupportedException ("NS_UNAVAILABLE");
 }
Example #3
0
 public override NSUrlSessionDownloadTask CreateDownloadTask(NSUrlRequest request)
 {
     throw new NotSupportedException ("NS_UNAVAILABLE");
 }
Example #4
0
 public override NSUrlSessionUploadTask CreateUploadTask(NSUrlRequest request, NSData bodyData)
 {
     throw new NotSupportedException ("NS_UNAVAILABLE");
 }
Example #5
0
 public virtual NSUrlSessionDownloadTask CreateDownloadTask(NSUrlRequest request, NSUrlSessionResponse completionHandler)
 {
     return CreateDownloadTask (request, GetCompletionHandler (completionHandler));
 }
Example #6
0
 public void Redirected(NSUrlProtocol protocol, NSUrlRequest redirectedToEequest, NSUrlResponse redirectResponse)
 {
     Messaging.void_objc_msgSend_IntPtr_IntPtr_IntPtr (this.Handle, Selector.GetHandle (selUrlProtocolWasRedirectedToRequestRedirectResponse_), protocol.Handle, redirectedToEequest.Handle, redirectResponse.Handle);
 }