A New York Petition for a Writ of Habeas Corpus under 28 USC 2241 is a legal document used to challenge the legality of a person's detention or incarceration. It is filed in a federal district court and is used to challenge the lawfulness of a person's detention by the government. The petitioner must demonstrate that he/she is being held in violation of their constitutional rights. The petition may be filed by the person in custody, or by their attorney on their behalf. There are two types of New York Petition for a Writ of Habeas Corpus under 28 USC 2241: 2241(c)(3) and 2241(d)(1). A 2241(c)(3) petition is used to challenge the legality of a person's detention based on the grounds that the government has violated the laws or regulations governing the detention. A 2241(d)(1) petition is used to challenge the lawfulness of a person's detention based on the grounds that the government has failed to provide them with a speedy trial.