The electron (hole) spin-photon interaction is studied in an asymmetrical InSb (Ge) nanowire quantum dot. The spin-orbit coupling in the quantum dot mediates not only a transverse spin-photon interaction, but also a longitudinal spin-photon interaction due to the asymmetry of the confining potential. Both the transverse and the longitudinal spin-photon interactions have non-monotonic dependence on the spin-orbit coupling. For realistic spin-orbit coupling in the quantum dot, the longitudinal spin-photon interaction is much (at least one order) smaller than the transverse spin-photon interaction. The order of the transverse spin-photon interaction is about 1 nm in terms of length |zeg| , or 0.1 MHz in terms of frequency eE0|zeg|/h for a moderate cavity electric field strength E0=0.4 V m-1.