title: Can't convert Alamofire request to Moya
body: <p>I have written an Alamofire request like below and get successful result.</p>
  <pre><code>let urlString = &quot;https://dev.thebeats.app/api/authorization/send_signup_email?lang=en&quot;
  let url = URL(string: urlString)!
  
  AF.request(url, method: .post,
                     parameters: [&quot;email&quot;: &quot;a@b.com&quot;],
                     encoding: URLEncoding.default,
                     headers: [&quot;Content-type&quot;: &quot;application/x-www-form-urlencoded&quot;],
                     interceptor: nil, requestModifier: nil)
              .response { result in
                  print(String(decoding: result.data!, as: UTF8.self))
              }
  </code></pre>
  <p>Here is the response</p>
  <pre><code>{
      &quot;status&quot;: 200,
      &quot;success&quot;: true,
      &quot;message&quot;: &quot;Email send successfully&quot;,
      &quot;body&quot;: {
          &quot;token&quot;: &quot;eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhbGciOiJIUzI1NiIsImlkIjo1Nywic3ViIjo1NywibmFtZSI6bnVsbCwiaWF0IjoxNjU1OTc5NTczLCJleHAiOjE2NTYwNjU5NzN9.331-g9WCEy6OIVkdm4UnxOx3BnuEx1fNy59shiYBgvQ&quot;
      }
  }
  </code></pre>
  <p>I have tried to write this request with Moya but always getting 404 error. Here is the code.</p>
  <pre><code>extension AuthenticationService: TargetType {
      var baseURL: URL {
          return URL(string: &quot;https://dev.thebeats.app/api&quot;)!
      }
      
      var path: String {
          switch self {
          case .registration:
              return &quot;/authorization/send_signup_email?lang=en&quot;
          }
      }
      
      var method: Moya.Method {
          switch self {
          case .registration:
              return .post
          }
      }
      
      var task: Task {
          switch self {
          case .registration(let email):
              var params: [String: Any] = [:]
                          params[&quot;email&quot;] = &quot;a@b.com&quot;
              return .requestParameters(parameters: params, encoding: URLEncoding.default)
          }
      }
      
      var headers: [String : String]? {
          switch self {
          case .registration:
              return [&quot;Content-type&quot;: &quot;application/x-www-form-urlencoded&quot;]
          }
      }
      
      var validationType: ValidationType {
          return .successCodes
      }
  }
  </code></pre>
  <p>Here is the response using <code>Moya</code></p>
  <pre><code>{
    &quot;message&quot;: &quot;Controller class Api could not be found.&quot;,
    &quot;url&quot;: &quot;/api/authorization/send_signup_email%3Flang=en&quot;,
    &quot;code&quot;: 404,
    &quot;file&quot;: &quot;/var/www/html/vendor/cakephp/cakephp/src/Controller/ControllerFactory.php&quot;,
    &quot;line&quot;: 340
  }
  </code></pre>
  <p>Please help me to figure it out. Thanks in advance.</p>