If you call http_request directly from candid ui you are going straight to the replica. If go want to pull the webpage from your browser you just use the url and the boundary node calls that query for you and pipes the result thru http.
Hard to say why you got a 404. Maybe it wasn’t deployed? Or wrong canister id? Did you get a response in candid ui?
I would like to obtain a GET API with a standard endpoint. Ideally, I would like to access this endpoint using a format such as http://[canisterId].localhost:4943/stream.
After reviewing HTTPS interface specification, it looks like I can send a POST request /api/v2/canister/<effective_canister_id>/query with the function details in the body. I tried this but I was unable to get a result.
I assume this is what you mean by “pull the webpage from your browser you just use the url and the boundary node calls that query for you and pipes the result thru http.”
I’ll dig in more. Any feedback that you have would be appreciated!
If http://[canisterId].localhost:4943/stream does not work, then maybe http://localhost:4943/stream?canisterId=[canisterid] works instead. But unless you’re using Safari both should work. You can see how we do it in CI with curl right here: curl --fail -vv http://localhost:"$PORT"/new_file.txt?canisterId="$ID"
The /api/v2 endpoint is not what you want to use for a REST API that you talk to via HTTP. It’s meant for use with an agent.
(Hopefully) stupid question: You’re deploying your canister to the local network, right? If you deploy to --network ic then you’d have to hit <canister id>.icp0.io instead
Thank you. My code was perfectly fine but I was passing in the wrong canister Id the entire time. I figured out that I should have done [id].localhost:4943/stream instead of [canisterId].localhost:4933/stream.