A man spat at one policeman and head-butted another when they said he wasn't allowed to use his phone while he was being arrested.
The officers had been called to the St John's Hostel on Hyde Park Road to arrest Gary Franks who was said to have breached a community order with an offence that, in the end was never taken further.
He was complying with the police and gathering his belongings until they said he couldn't use the phone.
At a hearing at Leeds Magistrates Court on Friday, the court was told it was then that he became aggressive and a scuffle between him and the police broke out.
The Crown Prosecution Service said: "He avoided being handcuffed and became aggressive. They had to use physical control over him and also used spray to negligible effect. He ended up wrestling with the officers. He is placed in a spit hood because he has been spitting and then spat at PC Parker over his arm.
"They got him in handcuffs and outside towards the police vehicle. PC Lamont was behind him where he reared backwards and tries to headbutt. He makes connection and hits his cheek. They were able to force him back to the floor where he is detained until other officers arrive."
The court heard there were no serious injuries caused to the policeman but Franks, aged 33, has previous for affray, escaping custody and battery among other convictions.
Stewart Page, mitigating, said: "He was arrested for unrelated matters that he wasn't charged with. He was released from the police station, goes to see his probation officer because he is not long out of prison and on licence. The officer does not suggest she will recall him and he returns to St John's Hostel. Later that evening the two officers attend to arrest him and it comes as a complete surprise.
"What seems to have broken the trust at that point was the defendant wanted to use his phone to ring his girlfriend to explain he was being recalled."
He was jailed for a total of 32 weeks with 16 weeks being given for each of the two counts. He will also be ordered to pay £122 in fines when he is released.
Chair of the bench Ruth Heatley said: "For the first offence we are sentencing you to 16 weeks. It was a sustained attack and caused more harm than you needed to. It is a most unpleasant thing to do.
"For the second offence, because this was again a sustained attack on the second officer and because your head is classed as a weapon you will also be sentenced to 16 weeks custody. We view them in the same seriousness."