Imperio is used to control someone's actions, it mightn't make them give you information.
All of the times we've seen the Imperius Curse used, it was to make someone do something. The actions may have required them to say certain things while carrying out the tasks they were Imperiused to perform, but Imperio has never been used to simply get information from someone. Fake-Moody used the Imperius Curse to control the actions of both the spider and Harry. Imperio seems to be mainly able to control what people do, and that probably wouldn't translate into being able to make them tell you something that they’d have known prior to being Imperiused. This quote gives us a look into Harry's mind when Fake-Moody used the Imperius Curse.
“And then he heard Mad-Eye Moody’s voice, echoing in some distant chamber of his empty brain: Jump onto the desk . . . jump onto the desk. . . . Harry bent his knees obediently, preparing to spring.
Jump onto the desk. . . .
Another voice had awoken in the back of his brain. Stupid thing to do, really, said the voice. Jump onto the desk. . . .
No, I don’t think I will, thanks, said the other voice, a little more firmly . . . no, I don’t really want to . . .
The next thing Harry felt was considerable pain. He had both jumped and tried to prevent himself from jumping — the result was that he’d smashed headlong into the desk, knocking it over, and, by the feeling in his legs, fractured both his kneecaps.
- Harry Potter and the Goblet of Fire, Chapter 15 (Beauxbatons and Durmstrang)
That doesn't seem like the kind of thing that would make him give information that was in his mind from before he was Imperiused. It would make him jump, but for example, might not make him tell Fake-Moody about his crush on Cho Chang. It seems like the Imperius Curse works to block out someone's thought process and replace it with whatever commands the person who cast the Imperius Curse wants them to follow. The mind of a person under the Imperius Curse is focused solely on the instructions they are given, and there is also an overwhelming peaceful feeling. They have no concerns, thoughts, or worries other than carrying out their given instructions. In that sort of mental state, it seems likely that the Imperiused person mightn't be able to access the information in their minds to be able to tell it. Having the instructions be "tell me what you know" seems unlikely to work, because it would require the Imperiused person to have a higher access to their minds than the Imperius Curse seems able to allow.
The command is likely answer no where the Dark Lord gives Harry the word he has to say.
The Dark Lord doesn't actually want a piece of information from Harry here. He wants to see Harry submit to him, to show fear. He doesn't want an actual answer, he wants Harry to say no, which is a direct command that doesn't require more access to thoughts than the ability to say the word no. Now presumably, Harry wouldn't have wanted the Dark Lord to use the Cruciatus Curse on him again, so answering no would have been the truth. However, whether it was true or not was irrelevant to the Dark Lord, who just wanted Harry to give in and say no.
It seems clear that Harry was given the exact words he was supposed to say because the only thing the Imperius Curse command is making him think is say no or answer no. Although it's unlikely that Harry would want the Dark Lord to torture him again, he probably wouldn't think it in such a repetitive way if it wasn't actually in the command. There are many ways to state "don't torture me again", like to give a few examples, "don't do that again" and "please stop". If it was simply Harry's own truthful thoughts, it seems unlikely all he'd be able to think is the same phrase.
Harry didn’t answer. He was going to die like Cedric, those pitiless red eyes were telling him so . . . he was going to die, and there was nothing he could do about it. . . but he wasn’t going to play along. He wasn’t going to obey Voldemort . . . he wasn’t going to beg. . . . “I asked you whether you want me to do that again,” said Voldemort softly. “Answer me! Imperio!” And Harry felt, for the third time in his life, the sensation that his mind had been wiped of all thought. . . . Ah, it was bliss, not to think, it was as though he were floating, dreaming . . . just answer no . . . say no . . . just answer no. . . .
I will not, said a stronger voice, in the back of his head, I won’t answer. . . . Just answer no. . . . I won’t do it, I won’t say it. . . . Just answer no. . . . “I WON’T!” And these words burst from Harry’s mouth; they echoed through the graveyard, and the dream state was lifted as suddenly as though cold water had been thrown over him — back rushed the aches that the Cruciatus Curse had left all over his body — back rushed the realization of where he was, and what he was facing. . . .
“You won’t?” said Voldemort quietly, and the Death Eaters were not laughing now. “You won’t say no? Harry, obedience is a virtue I need to teach you before you die. . . . Perhaps another little dose of pain?”
- Harry Potter and the Goblet of Fire, Chapter 3 ()
From this conversation, it seems very likely that the Dark Lord used the Imperius Curse to command Harry to answer no. It’s similar to how ‘Moody’ commanded him to jump onto the desk, and what he heard repeatedly was jump onto the desk. Here, Harry hears ‘answer no’ repeatedly in his mind, so it’s logical to conclude the Dark Lord’s command was ‘answer no’. It's a safe enough presumption that Harry wouldn't actually want to experience Crucio again, and so an answer of no would be at least at some level truthful, but the point in forcing him to say no is not to get an accurate and truthful answer. It's to get Harry to show fear of what the Dark Lord can do to him.
In the Moody example, it's never stated that the Imperius Curse is used to get information.
Barty Crouch Jr says that he kept Moody alive and under the Imperius Curse because he wanted to question him, but not that the Imperius Curse was the method of getting information. He could have been using the Imperius Curse to keep him compliant with being locked up in the trunk, but other methods to question him. By saying he kept him alive under the Imperius Curse because he wanted to question him, Crouch Jr. may have just meant that needing information from Moody meant he couldn't kill him. He’d previously been put under the Imperius Curse himself as a way of subduing him, he could have done the same thing to Moody when he needed to subdue him.
“Then I had to be concealed. I had to be controlled. My father had to use a number of spells to subdue me. When I had recovered my strength, I thought only of finding my master … of returning to his service.’
‘How did your father subdue you?’ said Dumbledore.
‘The Imperius Curse,’ Crouch said. ‘I was under my father’s control.”
- Harry Potter and the Goblet of Fire, Chapter 35 (Veritaserum)
What he said isn't in any way proof that Crouch Jr. used the Imperius Curse to get the information, it meant that using the Imperius Curse on him was what enabled him to keep Moody alive and captive. I kept him alive, under the Imperius Curse explains how he was able to contain a paranoid Auror like Moody without him constantly trying to escape.
Then I packed up Moody’s clothes and Dark detectors, put them in the trunk with Moody, and set off for Hogwarts. I kept him alive, under the Imperius Curse. I wanted to be able to question him. To find out about his past, learn his habits, so that I could fool even Dumbledore. I also needed his hair to make the Polyjuice Potion.
- Harry Potter and the Goblet of Fire, Chapter 35 (Veritaserum)
Crouch Jr. needing information, as well as a still-growing supply of hair for the Polyjuice Potion, explains why he didn't just kill Moody and bothered keeping him alive and Imperiused in the trunk. This does not mean that he was necessarily able to get information from Moody using the Imperius Curse. He could have used other methods, that the Imperius Curse was mentioned doesn't mean it was the method of extracting information. He could have tortured him to get him to give the information, either by Crucio or by other means of torture. For the length of time that Moody was in the trunk, Crouch Jr. would have had to keep him fed, and Moody would have inevitably had to eat the food at some point otherwise he would have starved to death. He could have put Veritaserum or another type of potion that would make him more willing to give up information. It's never mentioned if Crouch Jr. is a Legilimens, but if he is, he could have obtained information from Moody that way.