Can you explain the two ways you tried? Step by step.
I think it should return error via cURL in fact.