Orodruin said:
A priori, your integral is not well defined. It has poles on the real line. That is why you need the pole prescription. Different choices will give you different Green's functions.
Now you are talking! Contrary to your previous claims, indeed how you avoid the poles is crucial to get the correct Green's function needed for your problem in question. Since the confusion is thanks to Peskin&Schroeder, I suppose what you want is the time-ordered Green's function, defined (for a neutral scalar field) as
$$\Delta(x)=-\mathrm{i} \langle \Omega|\mathcal{T}_c \hat{\phi}(x) \hat{\phi}(0)|\Omega \rangle,$$
where
$$\mathcal{T}_c \hat{\phi}(x) \hat{\phi}(0)=\Theta(x^0) \hat{\phi}(x) \hat{\phi}(0) + \Theta(-x^0) \hat{\phi}(0) \hat{\phi}(x).$$
In vacuum it's identical with the Feynman propagator.
If, however, you have to calculate something in linear-response theory, you need the retarded propagator, defined as
$$\Delta_{\text{ret}}(x) =-\mathrm{i} \langle \Omega|\Theta(x^0) [\hat{\phi}(x),\hat{\phi}(0)] |\Omega \rangle.$$
Thanks to the ##\Theta## unit-step functions, the way to circumvent the poles are uniquely determined.
A pedagogically much better way to introduce the free propagators in QFT is to use the plane-wave mode decomposition with creation and annihilation operators and first evaluate the Mills representation, i.e., the Green's functions Fourier transformed with respect to ##\vec{x}## only. Then you first keep the time and can do the final Fourier transform wrt. to time at the end!