{"id":94,"date":"2014-01-07T21:41:49","date_gmt":"2014-01-07T21:46:52","guid":{"rendered":"https:\/\/c94f4php-curl.png"},"modified":"2015-07-16T19:40:00","modified_gmt":"2015-07-17T01:40:00","slug":"enviar-datos-por-post-mediante-curl-y-php","status":"publish","type":"post","link":"https:\/\/emanuelpaxtian.com\/blog\/enviar-datos-por-post-mediante-curl-y-php\/","title":{"rendered":"Enviar datos por POST mediante CURL y php"},"content":{"rendered":"<p>Muchas veces necesitamos automatizar ciertos procesos como el rellenado de formularios de forma autom\u00e1tica.<\/p>\n<p>Hoy vamos a explicar lo f\u00e1cil que es enviar una petici\u00f3n HTTP con datos por POST usando CURL.<br \/>\nTan solo es necesario indicar que se env\u00edan datos por POST e indicar qu\u00e9 datos se van a mandar:<br \/>\nCon CURLOPT_POST indicamos que enviamos datos en POST y con CURLOPT_POSTFIELDS indicamos los datos. Se pueden especificar mas datos por ejemplo el user agent del navegador etc.<\/p>\n<pre class=\"brush: php\">&lt;?php \r\n$ch = curl_init('http:\/\/dominio.com\/pagina.php');\r\ncurl_setopt ($ch, CURLOPT_POST, 1);\r\ncurl_setopt ($ch, CURLOPT_POSTFIELDS, \"parametro1=valor1&amp;parametro2=valor2\");\r\ncurl_exec ($ch);\r\ncurl_close ($ch);\r\n?&gt;\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Muchas veces necesitamos automatizar ciertos procesos como el rellenado de formularios de forma autom\u00e1tica. Hoy vamos a explicar lo f\u00e1cil que es enviar una petici\u00f3n HTTP con datos por POST&hellip;<\/p>\n","protected":false},"author":1,"featured_media":363,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-94","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-php"],"_links":{"self":[{"href":"https:\/\/emanuelpaxtian.com\/blog\/wp-json\/wp\/v2\/posts\/94","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/emanuelpaxtian.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/emanuelpaxtian.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/emanuelpaxtian.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/emanuelpaxtian.com\/blog\/wp-json\/wp\/v2\/comments?post=94"}],"version-history":[{"count":0,"href":"https:\/\/emanuelpaxtian.com\/blog\/wp-json\/wp\/v2\/posts\/94\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/emanuelpaxtian.com\/blog\/wp-json\/wp\/v2\/media\/363"}],"wp:attachment":[{"href":"https:\/\/emanuelpaxtian.com\/blog\/wp-json\/wp\/v2\/media?parent=94"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/emanuelpaxtian.com\/blog\/wp-json\/wp\/v2\/categories?post=94"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/emanuelpaxtian.com\/blog\/wp-json\/wp\/v2\/tags?post=94"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}