When Iran's Ministry of Information was burned by anti-shah rebels during the height of the riots here Sunday, foreign correspondents covering the insurrection reeled in mock dismay and sarcastically wondered among themselves how the outside world was ever going to know what was happening in Iran.

Their facetiousness may have overstated the shortcomings of the ministry and the difficulty of reporting from Iran, but not by much.

The fact is, the flow of news at the apex of the rebellion and after the imposition of a military government ran an obstacle course of bureaucratic and technical barriers that tested the ingenuity of everybody covering the event.

For Iranian journalists, life was simplified somewhat by the government that day. Iranian Army troops surrounded the offices of major newspapers and plainclothes SAVAK secret police agents walked in a announced that there would be no more publishing. As reporters and editors left singly, newsroom employes were screened and checked off a list, with 10 local journalists reportedly arrested.

For reporters of the state-owned National Radio and Television, life also was uncomplicated. Although battle tanks were positioned at the broadcasting headquarters to prevent a takeover by the rebels, the news employes were told simply to continue the same bland diet of obscure international news and features, while virtually ignoring the growing threat to the reign of Shah Mohammad Reza Pahlavi.

In some hourly news broadcasts of the French and English internation edition, there was no mention of the disturbance, even though a pall of black smoke hung over downtown Tehran as a result of fires causing uncounted millions of dollars in damage.

For the approximately 75 foreign reporters in Iran to cover the insurrection and for the handful of expatriot resident bureau chiefs of outside news agencies, no such clearly defined government edicts were issued.

Those who had obtained visas before the trouble broke out were allow-in, and those had not were sent home. From that point the ground rules became murky and the assignment became a cat-and-mouse game of getting information and getting it out.

It is often axiomatic in foreign reporting that when a correspondent finishes writing a story, about a third of his work is completely. The hardest part, sometimes, is getting the dispatch to his newspaper.

The axion seems inappropriate for Iran because of the obstacles to obtaining substantive information, but even taking that into account, it is not far off the mark.

For days, Iran came close to being shut off from the outside world, Despite having one of the most sophisticated telecommunications systems in the world. Outgoing overseas calls were all but impossible, and incoming calls were either delayed or frequently interrupted by disconnections.

At the peak of the crisis, the country's telex network disintegrated into a morass of garbled dispatches, and then collapsed entirely.

Wire services found their curcial teleprinter networks completely shut down, and in Tehran hotels even the usual bribe of 1,000-rials (almost $15) to telex operators turned out to be a useless gesture.

Correspondents gradually preceived that their incoming calls - essential for dictating dispatches - were being disconnected deliberately or monitored by government agents.

The arrest and expulsion from Iran of the United Press International bureau chief and the impounding of his office records by SAVAK agents did little to allay those suspicious. He was charged with "false and baseless reporting." Only Monday did UPI say the whole affair had been the result of an error and their their man had been granted a new visa.

Reporters visiting the Ministry of Information on the off chance of cleaning some nugget of news were handed an exhaustive questionnaire to fill out and asked to attach a photograph, presumably for Savak's files. In return, they were given no state press credentials, and more often than not they left the building having given more information than they received.

In September, before the advent of military rule a government spokesman blandly told two reporters that the minister of information would not be available for questions for the foreseeable future and that the government had no comment on the Sept. 8 "Black Friday" disturbance at Jaleh Square, in which hundreds of anti-shah protestors were shot by army troops.

Recently, the minister held a carefully controlled press conference to discuss the oil workers' strike, but the pattern essentially is unchanged; policy-making officials remain, for the most part, unapproachable, while their subordinates disclose little of substance.

The inevitable result was that correspondents went where information was available - to the opposition, to former government officials, to Western diplomats and to Iranians in the private sector whose long tenure as observers was a legitimate asset.

But the correspondents also knew that their sources shared common flaws - bias of varying degrees in the opposition, self-interest in the case of the foreign diplomats and remoteness from events in the case of the Iranian former officials and "political observers."

That correspondents covering the tumultuous events were forced to turn to sources that the shah presumably would consider not legitimate says something for the opposition's charges of government ineptitude.

Apologists for the government's reticence repeatedly said that openness of expression is not possible under martial law conditions and that, besides, the world press had already shown a penchant for distorting the government's viewpoint and exaggerating the extent of the rebellion.

There has been little evidence so far, that the gulf between the press and the government is narrowing.