The side effects of King Charles's cancer treatment "required a short period of observation in hospital", Buckingham Palace confirmed.