Let $D \subset \mathbb{C}$ be an open set and $f: \mathbb{D} \to \mathbb{C}$ be continious. If
\begin{align}
\int_\gamma f(z) {\rm d} z=0
\end{align}
for every closed piecewise curve $\gamma \in D$, then $f(z)$ is analytic on $D$.
I am looking for a similar statement for the complex-valued functions of several variables.
A reference would be good too.