Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Using the normal way to send http message with the NSURLConnection Framework doesn't run the i have try the CoreFoundation.Framework to do that:</p> <pre><code>-(void)implementaZioneChiamata{ for (int i = 0; i &lt; [_arrayOfSerial count]; i++) { CFStringRef urlFirst = CFSTR("http://192.168.30.9:88/virtualBadge.aspx?token="); CFStringRef token =(CFStringRef)_codicePWD; CFStringRef urlSecond = CFSTR("&amp;serial="); CFStringRef serial = (CFStringRef) [_arrayOfSerial objectAtIndex:i]; NSLog(@"URL: %@%@%@%@", urlFirst,token,urlSecond,serial); CFStringRef strs[4]; strs[0] = urlFirst; strs[1] = token; strs[2] = urlSecond; strs[3] = serial; CFArrayRef urlArray = CFArrayCreate(kCFAllocatorDefault, (void*)strs, 4, &amp;kCFTypeArrayCallBacks); CFStringRef urlCompleta = CFStringCreateByCombiningStrings(kCFAllocatorDefault, urlArray, CFSTR("")); NSLog(@"Url Completa: %@",urlCompleta); CFURLRef myURL = CFURLCreateWithString(kCFAllocatorDefault, urlCompleta, NULL); CFStringRef headerFieldName = CFSTR("host"); CFStringRef headerFieldValue = CFSTR("192.168.30.9"); CFStringRef requestMethod = CFSTR("GET"); CFHTTPMessageRef myRequest =CFHTTPMessageCreateRequest(kCFAllocatorDefault, requestMethod, myURL, kCFHTTPVersion1_1); CFHTTPMessageSetHeaderFieldValue(myRequest, headerFieldName, headerFieldValue); CFDataRef mySerializedRequest = CFHTTPMessageCopySerializedMessage(myRequest); NSString *messReq = [[NSString alloc] initWithData:(NSData*)mySerializedRequest encoding:NSASCIIStringEncoding]; CFStream NSLog(@"Serialized Request: %@", messReq); } </code></pre> <p>in the first part of code i create the URL. After this i Inizialize the CFHTTPMessageRef for create the HttpRequest.But now there is the problem:</p> <p>Once i have the HttpMessage to send it I need to Create the CFStreamRef for send the message. Starting to the idea that i create the stream how i can send message? With CFStream API?</p> <p>ok Guy Tnx all for Help after open the stream the request was Send adding de stream like this. </p> <pre><code>CFReadStreamRef myReadStream = CFReadStreamCreateForHTTPRequest(kCFAllocatorDefault, myRequest); CFReadStreamOpen(myReadStream); </code></pre> <p>Tnx all!!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload