If we put
$$I:=\int_0^\infty\frac{x^p}{1+x^2}dx$$
making the following variable change we get
$$x=-u\Longrightarrow dx=-du\Longrightarrow \int_{-\infty}^0\frac{x^p}{1+x^2}dx=\int_\infty^0\frac{(-1)^pu^p}{1+u^2}(-du)=(-1)^pI$$
so that
$$\int_{-\infty}^\infty\frac{x^p}{1+x^2}dx=\left(1+(-1)^p\right)I=\left(1+e^{p\pi i}\right)I\Longleftrightarrow$$
$$\Longleftrightarrow \,\,(***)\,\,\,I=\Re\left(\frac{1}{1+e^{p\pi i}}\right)\int_{-\infty}^\infty\frac{x^p}{1+x^2}dx=\frac{1}{2}\int_{-\infty}^\infty\frac{x^p}{1+x^2}dx$$
For $\,p\geq 0\,$ let us try the following contour, with $\,1<R\in\Bbb R\,$:
$$C:=[-R,R]\cup\left(\gamma_R:=\left\{z\in\Bbb C\;:\;z=Re^{it}\,\,,0\leq t\leq\pi\right\}\right)$$
Putting
$$f(z):=\frac{z^p}{1+z^2}\Longrightarrow Res_{z=i}(f)=\lim_{z\to i}(z-i)f(z)=\frac{i^p}{2i}=\frac{e^{p\pi i/2}}{2i}$$
so by CIT we get
$$\oint_Cf(z)\,dz=2\pi i\frac{1}{2i}e^{p\pi i/2}=\pi \left(\cos\frac{p\pi}{2}+i\sin\frac{p\pi}{2}\right)$$
Now, by the estimation lemma, we get
$$\left|\int_{\gamma_R}f(z)\,dz\right|\leq \max_{z\in\gamma_R}\frac{|z|^p}{|1+z^2|}R\pi\leq \frac{\pi R^{p+1}}{1-R^2}\xrightarrow [R\to\infty]{} 0\,\,,\,\text{since}\,\,p+1<2$$
Thus, taking the limit above, we get
$$(@@@)\,\,\,\pi \left(\cos\frac{p\pi}{2}+i\sin\frac{p\pi}{2}\right)=\lim_{R\to\infty}\oint_Cf(z)dz=\int_{-\infty}^\infty\frac{x^p}{1+x^2}dx\Longrightarrow$$
$$\int_{-\infty}^\infty\frac{x^p}{1+x^2}dx=\pi\cos\frac{p\pi}{2}\Longleftrightarrow$$
$$\stackrel{\text{from (***) above}}\Longleftrightarrow I=\frac{\pi\cos p\frac{\pi}{2}}{2}\,\,\,\,\,Q.E.D.$$
Now, for $\,-1< p<0\,$ all the above remains mutatis mutandi but there's also the matter of the pole at $\,z=0\,$ ,which I can't handle as I can't manage to find out what is this pole's multiplicity. Yet I'm almost sure the residue here is zero, but can't prove it.
Added: As did proposes in a comment below, let's use the following change of variables:
$$x=\frac{1}{u}\Longrightarrow dx=-\frac{du}{u^2}\Longrightarrow I(p):=\int_\infty^0\frac{u^{-p}}{1+\frac{1}{u^2}}\left(-\frac{du}{u^2}\right)=:I(-p)$$
so that all we did above indeed remains valid when $-1< p<0\,$
Added trying to address Joriki's point in the comments below: We got, 3 lines before $\,(***)\,$, that
$$\int_{-\infty}^0\frac{x^p}{1+x^2}dx=e^{ip\pi}I\Longrightarrow \int_{-\infty}^\infty\frac{x^p}{1+x^2}dx=\int_{-\infty}^0\frac{x^p}{1+x^2}dx+\int_0^\infty\frac{x^p}{1+x^2}dx=$$
$$=(1+e^{ip\pi})I$$
and as Joriki remarks from this it follows
$$I=\frac{1}{1+e^{ip\pi}}\int_{-\infty}^\infty\frac{x^p}{1+x^2}dx$$
without taking the real part in the RHS , and thus in $\,(@@@)\,$ we actually have
$$\int_{-\infty}^\infty\frac{x^p}{1+x^2}dx=\pi\left(\cos p\frac{\pi}{2}+i\sin p\frac{\pi}{2}\right)=\pi e^{ip\pi}$$
and from here we get the same result as Mercy got below:
$$I=\frac{\pi e^{ip\pi}}{1+e^{ip\pi}}=\frac{\pi}{2}\sec p\frac{\pi}{2}$$