Hi Team, Can someone please help here? 

I wanted to replace the response content with some value. Here is my code

def someRoute: Route = path(“ci” / “anomaly” / “detection” / "location" / 
Segment / Segment / “units” / IntNumber) { (country, businessUnit, store) =>

  get {

    extractRequest { req =>

      val sbuUri = s”*$*{*someHost*}/ci/anomaly/detection/location/*$*
{country}/*$*{businessUnit}/units/*$*{*storeMap*.getOrElse(store, 
store).toString}"

      onComplete(*http*.singleRequest(request = *HttpRequest*(uri = sbuUri, 
headers = req.headers))) {

        case Success(resp) => complete(resp)

        case Failure(ex) => complete((StatusCodes.*InternalServerError*, 
s"An error occurred: *$*{ex.getMessage}"))

      }

    }

  }

}


and I wanted to replace something like this

case Sucess(resp) => complete(resp.replace("oneString","Other"))

How can I achieve this one in scala http one?



-- 
*****************************************************************************************************
** New discussion forum: https://discuss.akka.io/ replacing akka-user 
google-group soon.
** This group will soon be put into read-only mode, and replaced by 
discuss.akka.io
** More details: https://akka.io/blog/news/2018/03/13/discuss.akka.io-announced
*****************************************************************************************************
>>>>>>>>>> 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>>      Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/akka-user/a1354038-6e50-4932-98cf-2e33fb12f0e9%40googlegroups.com.

Reply via email to