title: Where did setHTTPMethod, setURL and setHTTPBody go in swift?
body: <p>I am trying to implement HTTP requests.</p>
  
  <p>Here is the objective C implementation</p>
  
  <pre><code>         NSMutableURLRequest *request = [[NSMutableURLRequest alloc] init];
          [request setURL:url];
          [request setHTTPMethod:@"POST"];
          [request setValue:postLength forHTTPHeaderField:@"Content-Length"];
          [request setValue:@"application/json" forHTTPHeaderField:@"Accept"];
          [request setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"Content-Type"];
          [request setHTTPBody:postData];
  </code></pre>
  
  <p>I started by writing:</p>
  
  <pre><code>       let request = NSMutableURLRequest()
         request .setValue(postLength, forHTTPHeaderField: "Content-Lenght")
         request .setValue(application/json, forHTTPHeaderField: Accept)
  </code></pre>
  
  <p>1.The json request is giving me an error.</p>
  
  <p>2.I cannot convert the setURL and SetHTTPBody from objective C to swift. I could not find
      the option for these.</p>
  
  <p>Any help would be appreciated.
  Thank you.</p>