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.

2 Likes