Even though there is no consensus, many autistic children have digestive problems that are a puzzle to the parents and medical professionals. When my autistic spectrum son was young, we had a lot of difficulties with his diet. Trying to make him eat certain foods, like veggies, was nearly impossible. Other foods produced reactions, such as you describe.
I ended up noting which foods produced a reaction and eliminating them from his diet. It did him no harm not to eat brocolli or salad. I made sure he had some vegetables in a form he could tolerate, but pretty much taylored his diet according to what he would willingly eat with no harmful side effects.
First, eliminate the foods you know he is sensetive to. Then, when he eats something and has an unexpected reaction, make a list of the foods he has recently eaten and use process of elimination to figure out which one caused it. Finally, make sure he has a well-rounded diet by going back in and adding foods to take the place of those eliminated. For example, if your son had difficulty with milk, eliminate the milk but add in another source of calcium, such as soy milk. Just make sure he has foods from every category. When he is more mature, you can go back and slowly expose him to foods to increase his tolerance, if you choose.
Last of all, turn a blind eye to those around you who may criticize you for not forcing him to eat foods he cannot tolerate. Many well-meaning parents have the "whatever you serve for dinner is what he should eat" mentality. That may work for some children, but most of the parents who will tell you this have never had to deal with autistic melt-downs on a daily basis.