title: Postman Body Raw Request To Swift Alamofire
body: <p>I'm trying to re-create this Postman settings for posting in Alamofire. This is my first time to see an API that requires both Parameters and a body with Raw Json.</p>
  
  <p>I'm done with gathering and formatting my data (either in Json using SwiftyJSON or Dictionary <code>[String : Any]</code> / <code>Parameters</code>) for the said requirement.</p>
  
  <p><a href="https://i.stack.imgur.com/TR626.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/TR626.png" alt="enter image description here"></a></p>
  
  <p>While I did see a similar question to this: <a href="https://stackoverflow.com/questions/37289792/postman-request-to-alamofire-request">Postman request to Alamofire request</a> but it doesn't have a valid answer. Assume that I'm quite experienced with posting/getting/etc data from various API but I just don't know how to pass raw data just like in the photo above. Please check out my comments too in the code.</p>
  
  <p>Here's what I'm doing with my function for this request:</p>
  
  <pre><code>/** Apply to job with Shift.
   *  This service function creates a json data for applying.
   */
  
  func someFuncService(_ job: Job, daySchedules: [(Int, String, Schedule)], withBlock completion: @escaping JobServiceCommonCallBack) {
      AuthService.someFunc { (currentCustomer, accessToken) in
          guard let lalala = currentCustomer?.id,
              let accessT = accessToken else {
                  completion(LalaErrors.currentCustomerError)
                  return
          }
  
          guard let jobId = job.id else {
              completion(LalaErrors.modelError)
              return
          }
  
  
          let coreService = LalaCoreService()
  
          let applicantEndpoint = LalaCoreService.Endpoint.Applicant
  
          let parameters = [
              "param1" : customerId,
              "param2" : jobId,
              "accessToken" : accessToken,
              "shift" : self.generateDataFromDaySchedules(daySchedules) // this returns [String : Any], can be printed into Json using JSON(x)
              ] as Parameters
  
          GPLog(classSender: self, log: "FINAL PARAMETER: \(parameters)")
  
          coreService.request = Alamofire.request(
              applicantEndpoint,
              method: .post,
              parameters: parameters,
              encoding: URLEncoding.default, // I already have tried .httpbody too.
              headers: nil
          )
  
          coreService.request {
              (response, result) in
  
              if let error = result?.error {
                  if response!.statusCode == 500 {
                      completion(GPKitError.newError(description: "Failed to apply. Please contact the admin."))
                      return
                  }
  
                  completion(error)
                  return
              }
  
              // Success
              completion(nil)
              return
          }
      }
  }
  </code></pre>
  
  <p>EDIT: So the question is, what I'm doing wrong here? API returns me status code 500 internal server error. </p>