Recently, an anisotropic cosmological model was proposed. An arbitrary one-form, which picks out a privileged axis in the universe, was added to the Friedmann Robertson Walker (FRW) line element. The distance-redshift relation was modified such that it is direction-dependent. In this paper, we use the Union2 dataset and 59 high-redshift gamma-ray bursts (C.:411Es) to give constraints on the anisotropy of the universe. The results show that the magnitude of anisotropy is about D = 0.044 0.018, and the privileged axis points toward the direction (to, ho) = (306.1" 18.7", 18.2" 11.2') in the galactic coordinate system. The anisotropy is small and the isotropic cosmological model is an excellent approximation.