Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make constructQuery typesafe #62

Closed
BenFradet opened this issue Jul 5, 2018 · 0 comments
Closed

Make constructQuery typesafe #62

BenFradet opened this issue Jul 5, 2018 · 0 comments
Assignees
Milestone

Comments

@BenFradet
Copy link
Contributor

We can make

def constructQuery(appId: String): String = {
val end = endpoint.map(e => s"$e/$resource").getOrElse(s"$resource")
val params = parameters ++ Map("appid" -> appId)
val queryString = params.map { case (a, b) => s"$a=$b" }.mkString("&")
s"/data/2.5/$end?$queryString"
}
}

typesafe by leveraging hammock's Uri

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants