Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8457139
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T12:43:59+00:00 2026-06-10T12:43:59+00:00

The end goal is to connect two query parameters that are being passed to

  • 0

The end goal is to connect two query parameters that are being passed to a Play! web service request. It looks like:

WS
.url(requestUri)
.withQueryString(finalQueries)

I attempted to use a couple operators but it failed like so:

val finalQueries = queryParams match {
        case Some(queries) =>
          tokenParam ++ queries
        case None =>
          tokenParam
}

Error: value ++ is not a member of (String, String)

The API documentation shows that withQueryString accepts a (String, String)*

I’m a little confused with Play!’s withQueryString method since it does appear to complete replace the entire query string every time I access it. Any way to decently combine query strings?

Edit: A sample query string is below (the type syntax and its final appearance are a little confusing…):

val queryString = ("timeMin" -> "2012-08-20T01%3A11%3A06.000Z")

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T12:44:01+00:00Added an answer on June 10, 2026 at 12:44 pm

    from your code, it seems to me that queryParams should be Option[(String, String)], and from the error message, tokenParam must be (String, String)
    I think you can try this:

    val finalQueries = Seq(tokenParam) ++ queryParams
    WS
    .url(requestUri)
    .withQueryString(finalQueries:_*)
    

    it works because Option can be treated as Seq, eg: Seq(1, 2) ++ Some(3) will become Seq(1, 2, 3) and Seq(1, 2) ++ None will be just Seq(1, 2)

    and then .withQueryString accepts a (String, String)* means you can call it like .withQueryString(param1, param2, andMore),
    or you can call it with a Seq and tell the compiler to treat it like anythingRepeated by writing : _* at the end of the Seq like .withQueryString(Seq(param1, param2, andMore): _*)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My end goal is to draw a report that looks like MS Word using
First off, let me define the end goal: I'd like to Wordpress (version 2.8)
The end goal is to have some form of a data structure that stores
I'm learning javascript and noticed the following two syntaxes achieve the same end goal:
My end goal is to create a firefox extension that inserts an HTML button
My end goal is to produce a simple .deb package. For that I've read
I'd like to use Socket.io and Node.js to do push notifications. The end goal
My end goal is to accomplish something like: CREATE FOREIGN KEY IF NOT EXISTS
My end goal is to create a checkbox that, when selected, checks all the
my end goal is to have two apps, a main app (which will do

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.