Why do I feel like I’m having contractions when I poo?

This is so random. I’m 38 weeks and have not had any contractions at all yet but every time I go to the toilet to poop I get the intense contraction pain where I want to throw up and breathing heavy. It’s only when I poop though? And I’m not in Labour so I don’t understand