Note that there are some explanatory texts on larger screens.

plurals
  1. PORequest Payload in a POST request
    text
    copied!<p>I am trying to scrape a PHP website and instead of Form Data i am seeing Payload requests in Header Section. What is a Payload Request? I am using Developer Tools from Chrome to analyse the Data.</p> <p>For example: </p> <pre><code>Request Payload ------WebKitFormBoundaryWEXJCV0v7CwVqn0X Content-Disposition: form-data; name="Command" -1 ------WebKitFormBoundaryWEXJCV0v7CwVqn0X Content-Disposition: form-data; name="name_1" 12 ------WebKitFormBoundaryWEXJCV0v7CwVqn0X Content-Disposition: form-data; name="pass_1" 34 ------WebKitFormBoundaryWEXJCV0v7CwVqn0X Content-Disposition: form-data; name="logins" Είσοδος ------WebKitFormBoundaryWEXJCV0v7CwVqn0X Content-Disposition: form-data; name="email" </code></pre> <p>All i want to do is scrape a website which requires username and password.</p> <pre><code>My code is this: function get_data_with_post_fields($url, $fields_data) { $ch = curl_init(); $timeout = 5; curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_USERAGENT,'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout); curl_setopt($ch, CURLOPT_ENCODING, ""); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS,$fields_data); curl_setopt($ch, CURLOPT_FRESH_CONNECT, 1); $data = curl_exec($ch); curl_close($ch); return $data; } $url_to_scrape = 'http://www.awebsite.com/index.php?com=products&amp;id=10000'; $PF = "&amp;name_1=xxx&amp;pass_1=xxx"; print $raw = get_data_with_post_fields($url_to_scrape,$PF); </code></pre> <p>How should i form my POST REQUEST? Any help will be much appreciated.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload