\doxysection{api/registrar\+Voto.php File Reference}
\hypertarget{registrarVoto_8php}{}\label{registrarVoto_8php}\index{api/registrarVoto.php@{api/registrarVoto.php}}


Recebe um voto através de uma string json obtida via um POST request.  


\doxysubsubsection*{Variables}
\begin{DoxyCompactItemize}
\item 
\mbox{\hyperlink{registrarVoto_8php_a1a37d7994caf19ad5a87ac643651e578}{\$votos}} = json\+\_\+decode(file\+\_\+get\+\_\+contents(\textquotesingle{}php\+://input\textquotesingle{}))-\/$>$votos
\begin{DoxyCompactList}\small\item\em Objeto com os votos do usuário. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
Recebe um voto através de uma string json obtida via um POST request. 

PHP version 5.\+3+

\begin{DoxyAuthor}{Author}
Paulo Roma \href{mailto:roma@lcg.ufrj.br}{\texttt{ roma@lcg.\+ufrj.\+br}} 
\end{DoxyAuthor}
\begin{DoxyCopyright}{Copyright}
2019-\/2022 Paulo Roma 
\end{DoxyCopyright}
\begin{DoxyVersion}{Version}
SVN\+: \$\+Id\$ 
\end{DoxyVersion}
\begin{DoxySeeAlso}{See also}
\href{/cwdc/7-mysql/urna-vercel/api/registrarVoto.php}{\texttt{ link}} 

\href{https://www.php.net/manual/en/function.file-get-contents.php}{\texttt{ https\+://www.\+php.\+net/manual/en/function.\+file-\/get-\/contents.\+php}} 

\href{https://www.php.net/manual/en/function.empty.php}{\texttt{ https\+://www.\+php.\+net/manual/en/function.\+empty.\+php}} 

\href{https://www.php.net/manual/en/function.is-null.php}{\texttt{ https\+://www.\+php.\+net/manual/en/function.\+is-\/null.\+php}} 

\href{https://www.geeksforgeeks.org/how-to-receive-json-post-with-php/}{\texttt{ https\+://www.\+geeksforgeeks.\+org/how-\/to-\/receive-\/json-\/post-\/with-\/php/}} 
\end{DoxySeeAlso}
\begin{DoxySince}{Since}
31/07/2022 
\end{DoxySince}


Definition in file \mbox{\hyperlink{registrarVoto_8php_source}{registrar\+Voto.\+php}}.



\doxysubsection{Variable Documentation}
\Hypertarget{registrarVoto_8php_a1a37d7994caf19ad5a87ac643651e578}\label{registrarVoto_8php_a1a37d7994caf19ad5a87ac643651e578} 
\index{registrarVoto.php@{registrarVoto.php}!\$votos@{\$votos}}
\index{\$votos@{\$votos}!registrarVoto.php@{registrarVoto.php}}
\doxysubsubsection{\texorpdfstring{\$votos}{\$votos}}
{\footnotesize\ttfamily \$votos = json\+\_\+decode(file\+\_\+get\+\_\+contents(\textquotesingle{}php\+://input\textquotesingle{}))-\/$>$votos}



Objeto com os votos do usuário. 

Receive JSON string as post data, by taking raw data from the request and converting it into a PHP object.


\begin{DoxyPre}
\$votos: Array
  (
      [0] => stdClass Object
          (
              [etapa] => vereador
              [numero] => 55555
          )

      [1] => stdClass Object
          (
              [etapa] => prefeito
              [numero] => 15
          )
  )
\end{DoxyPre}
 

Definition at line \mbox{\hyperlink{registrarVoto_8php_source_l00048}{48}} of file \mbox{\hyperlink{registrarVoto_8php_source}{registrar\+Voto.\+php}}.

