package main

import (


func main() {

    router := mux.NewRouter().StrictSlash(true)
    router.HandleFunc("/todos/{todoId}", getCallHistory)

    log.Fatal(http.ListenAndServe(":8080", router))

func GetcallHistory(w http.ResponseWriter, r *http.Request) {
    vars := mux.Vars(r)
    todoId:= vars["todoId"]
    fmt.Fprintln(w, "GetmemberId:", todoId})


func callRemoteapi(id string){

 fmt.Println("Starting the application...")
   fmt.Println("The value of id is", id)
    response, err := 
    if err != nil {
        fmt.Printf("The HTTP request failed with error %s\n", err)
    } else {
        data, _ := ioutil.ReadAll(response.Body)


In the above code, I am trying to pass Id value in the{id}. I want this remote api to 
take the id as parameter and return the data in the json format. Any help 
is Appreciated.

You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
For more options, visit

Reply via email to