Skip to content

formParameters doesn't work #13

@samthebest

Description

@samthebest

cc @stacycurl

I have to construct the query params my self, if I use formParameters on a request it doesn't seem to work (I get 404).

  def get(uri: String, params: Map[String, String]): Future[Response] = {
    val formParams: List[FormParameter] = params.map(kv => FormParameter(kv._1, kv._2)).toList

    val paramSuffix: String = if (params.isEmpty) "" else s"?${params.map(kv => kv._1 + "=" + kv._2).mkString("&")}"

    Future {

      // Works
      http(
        GET(uri + paramSuffix)
      )

      // Not work
      http(
        GET(uri)
          .formParameters(formParams: _*),
      )
    }
  }

Also FormParameter seems like a fairly redundant type, could just use Map[String, String]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions