c# - What is Xamarin Studio's class HttpWebRequest replacement in Objective C? -
I am pretty new to zaminin studio and I need to use a functionality in my code which i I am writing in, which is from the second code, which was previously written in Xeramin (C #).
The exormine code is a byte stream of an image attached to an HttpWebRequest example and posted on a server to obtain a processed image.
How can I use the same functionality of code in XMRIA
using (stream = (HttpWebRequest) WebRequest.Create (string.Concat (new string [] {common .bas edder, "visualize /", generichalper.sevens encrypt (normal.Token), "/", normal.appappag, (Stream request stream = httpWebRequest.GetRequestStream ()) by using HttpWebRequest.ContentType = "application / x-www-form-urlencoded"; ) {Int num = 2048; int i = 1; int num2 = pBytePhotoImage.Length; while (i & lt; num2) {if (i + num> num2) {num = num2 - i;} RequestStream.Write (pBytePhotoImage , I-1, num); float f progress = (float) i / (float) number 2; if (f; progression; = 1f) {nSAutoreleasePool.InvokeOnMainThread (rep {pProgressBar.set_Progress (fProgress);}) ;} Else {nSAutoreleasePool.InvokeOnMainThread (Representative {pProgressBar.set_Progress (1f);})}} I + = num; } NSAutoreleasePool.InvokeOnMainThread (Rep {pAnimationImage.StartAnimating ();}); }
I can be assembled and implemented by searching on the Internet: -
My aim is C code as follows: - < Pre> NSDTA * data = UIImageJPEG reputation (self.imageView.image, 0.2); NSString * webServiceURL = @ "https: // webserviceNameBaseAddress / visualize / lEr0WKCdarv2FLGFvBRbhs41FN7zhgcdiwuEqFtLQINJ | PQpM8HEGQ ~~ / iOS / SL | VL | OC | ML |"; NSMutableURLRequest * Request = [[NSMutableURLRequest alloc] init]; [Request URL: [NSURL URLWithString: webServiceURL]]; [Set http system: @ "post"]; [Request Set Value: HTTP HeaderField for @ "App / X-www-Form-URLXode": @ "Content-Type"]; [Set htmlbb: data]; [Send NSRR ConnectionSyncronSews: Request Qi: Closing Handseller: [NSRRSRONS * Response, NSDT * READDATA, NSERR * IR] {NSLOG (@ URL Response); if (error) {NSLOG (@ "ERR% @" , Err.description);} and {if (response data) {NSLog (@ "% @", [UIImage imageWithData: responseData]);} other {NSLog (@ "nothing returned");}}}]; < / Code> Now when I run the code in Xcode: OU Error: -
Error domain = NSURLErrorDomain code = -1000 "bad url" UserInfo = 0x75a9ea0 {NSUnderlyingError = 0x7189250 "bad url", nslocalyated description = bad url} Any help would be great, I got stuck on it after two days.
PS: - To remove the webserver URL for the post request, from the XMERIN app code. I had printed the URL string with the help of the console, with the help of Xamarin and
This may be the security of iOS, the exact output in Xcode is used as the NSMUTABLE URRIEST. That it can help you -
Comments
Post a Comment