Back to Collection Items
// This example assumes the Chilkat API to have been previously unlocked.
// See Global_Ref.html">Global_Ref.html">Global_Ref.html">Global_Ref.html">Global_Ref.html">Global_Ref.html">Global_Ref.html">Global Unlock Sample for sample code.
http := Http_Ref.html">Http_Ref.html">Http_Ref.html">Http_Ref.html">Http_Ref.html">Http_Ref.html">Http_Ref.html">chilkat.NewHttp()
var success bool
http.SetBasicAuth(true)
http.SetLogin("{{secretId}}")
http.SetPassword("{{secretPassword}}")
queryParams := JsonObject_Ref.html">JsonObject_Ref.html">JsonObject_Ref.html">JsonObject_Ref.html">JsonObject_Ref.html">JsonObject_Ref.html">JsonObject_Ref.html">chilkat.NewJsonObject()
queryParams.UpdateInt("page",1)
resp := HttpResponse_Ref.html">HttpResponse_Ref.html">HttpResponse_Ref.html">HttpResponse_Ref.html">HttpResponse_Ref.html">HttpResponse_Ref.html">HttpResponse_Ref.html">chilkat.NewHttpResponse()
success = http.HttpParams("GET","https://domain.com/investments/portfolios/",queryParams,resp)
if success == false {
fmt.Println(http.LastErrorText())
http.DisposeHttp()
queryParams.DisposeJsonObject()
resp.DisposeHttpResponse()
return
}
fmt.Println(resp.StatusCode())
fmt.Println(resp.BodyStr())
http.DisposeHttp()
queryParams.DisposeJsonObject()
resp.DisposeHttpResponse()
Curl Command
curl -G -d "page=1"
-u '{{secretId}}:{{secretPassword}}'
https://domain.com/investments/portfolios/
Postman Collection Item JSON
{
"name": "List",
"request": {
"method": "GET",
"header": [
],
"url": {
"raw": "{{baseUrl}}/investments/portfolios/?page=1",
"host": [
"{{baseUrl}}"
],
"path": [
"investments",
"portfolios",
""
],
"query": [
{
"key": "page",
"value": "1"
}
]
}
},
"response": [
]
}