Why curl fails while browser calls succeed?