Consider the following contour integral:
$$\oint_C \frac{dz}{z^y+1}$$
where $C$ is a wedge which has four sections: 1) along the positive real axis from $[\epsilon,R]$; 2) along an arc of radius $R$ from the positive real axis, counterclockwise to the point $z=R e^{i 2 \pi/y}$; 3) along the line segment $z=e^{i 2 \pi/y} t$, $t \in [R,\epsilon]$; 4) a small arc of radius $\epsilon$ about the origin of angle $2 \pi/y$. Thus the contour integral is equal to
$$\int_{\epsilon}^R \frac{dx}{x^y+1} + i R \int_0^{2 \pi/y} d\theta \, \frac{e^{i \theta}}{R^y e^{i y \theta}+1} + e^{i 2 \pi/y} \int_R^{\epsilon} \frac{dt}{t^y+1} + i \epsilon \int_{2 \pi/y}^0 d\phi \, \frac{ e^{i \phi}}{\epsilon^y e^{i y \phi}+1}$$
As $R \to \infty$, the second integral vanishes because $y \gt 1$; as $\epsilon \to 0$, the fourth integral vanishes. By the residue theorem, the contour integral is also equal to $i 2 \pi$ times the residue at $z=e^{i \pi/y}$. Thus,
$$\left (1-e^{i 2 \pi/y}\right ) \int_0^{\infty} \frac{dx}{x^y+1} = \frac{i 2 \pi}{y \,e^{i \pi (y-1)/y}} = -\frac{i 2 \pi}{y} e^{i \pi/y}$$
Thus,
$$\int_0^{\infty} \frac{dx}{x^y+1} = -\frac{i 2 \pi}{y} \frac{e^{i \pi/y}}{1-e^{i 2 \pi/y}} = \frac{\pi/y}{\sin{(\pi/y)}}$$
ADDENDUM
I added the small arc over which the integral vanishes so as to avoid a branch point at $z=0$ for nonintegral $y$. Although it has no impact on the result, the derivation was not quite correct without it. It should be a habit to define integration contours so as to avoid branch points if Cauchy's theorem is to be invoked.