Is it possible for http_request method to NOT be only query, but also update method?

Hey there

I am testing locally making a canister http_request method make an inter-canister call to check upon data in another canister and then return proper HttpResponse (but not before checking that other canister to confirm that data to be returned CAN actually be returned).

When trying to deploy, this however, gives me misplaced await error and does not want to deploy, for any combination of either:

  • Making http_request in asset canister a query method and then doing inter-canister call to a public shared method of the canister where I want to return data from, or
  • Making http_request in asset canister NOT a query method and then doing inter-canister call to a query method in of the canister where I want to return data from

Making me believe that http_request method HAS to always be a query method (or am I wrong and it doesn’t have to be a query method)?

Yes, http_request has to be query method, but you can upgrade it to let the HTTP Gateway call http_request_update.

3 Likes

@domwoe ,

What is the curl command to call the http_request method when I deploy the example to mainnet?

I am not sure what URL to use…

1 Like

Actually, scratch that :wink:

I figured it out, that simply:

curl https://<canister-id>.raw.icp0.io

does the job.

2 Likes