title: How can I tell if my HTTP request is succeeding or failing?
body: <p>Let's say there's a form that you submit to using radio buttons and a standard &quot;submit&quot; button. I want to be able to submit a response to the form not from the website but from the command line with cURL.</p>
  <p>When I submit the form on my browser and examine network traffic, here are the important details I see:</p>
  <p>URL (sample): <a href="http://www.example.com/folder/ajax.php" rel="nofollow noreferrer">www.example.com/folder/ajax.php</a></p>
  <p>Data: {big string of JSON stuff}</p>
  <p>Here is the curl call I'm trying:</p>
  <pre><code>curl -X POST -H &quot;Content-Type: application/json&quot; -L -d '{big string of json stuff}' http://www.example.com/folder/ajax.php --verbose
  </code></pre>
  <p>The problem I'm experiencing is that my request isn't actually doing anything, namely, I'm not seeing the changes on the website I would expect after submitting the form. Help?</p>
  <p>EDIT: I can see my request is failing. A successful call returns something like the line below, which is not appearing. So the question is what's wrong with my call.</p>
  <pre><code>{&quot;success&quot;:true,&quot;data&quot;:{website specific stuff}}
  </code></pre>
  <p>For reference here is what I get when I make the call:</p>
  <pre><code>Note: Unnecessary use of -X or --request, POST is already inferred.
    % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                   Dload  Upload   Total   Spent    Left  Speed
    0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0*   Trying 001.01.001.01:01...
  * Connected to www.example.com (001.01.001.01) port 80 (#0)
  &gt; POST /example-admin/admin-ajax.php HTTP/1.1
  &gt; Host: www.example.com
  &gt; User-Agent: curl/7.70.0
  &gt; Accept: */*
  &gt; Content-Type: application/json
  &gt; Content-Length: 273
  &gt;
  } [273 bytes data]
  * upload completely sent off: 273 out of 273 bytes
  * Mark bundle as not supporting multiuse
  &lt; HTTP/1.1 301 Moved Permanently
  &lt; Date: Mon, 20 Jul 2020 20:10:06 GMT
  &lt; Transfer-Encoding: chunked
  &lt; Connection: keep-alive
  &lt; Cache-Control: max-age=3600
  &lt; Expires: Mon, 20 Jul 2020 21:10:06 GMT
  &lt; Location: https://www.example.com/example.php
  &lt; cf-request-id: 040f721ebb000056c7c49ef200000001
  &lt; Server: cloudflare
  &lt; CF-RAY: 5b5f52ddff2656c7-IAD
  &lt;
  * Ignoring the response-body
  { [5 bytes data]
  100   273    0     0  100   273      0   1560 --:--:-- --:--:-- --:--:--  1578
  * Connection #0 to host www.example.com left intact
  * Issue another request to this URL: 'https://www.example.com/folder/admin-ajax.php'
  * Switch from POST to GET
  *   Trying 001.01.01.01:001...
  * Connected to www.example.com (001.01.01.01) port 443 (#1)
  * ALPN, offering h2
  * ALPN, offering http/1.1
  * successfully set certificate verify locations:
  *   CAfile: C:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt
    CApath: none
  } [5 bytes data]
  * TLSv1.3 (OUT), TLS handshake, Client hello (1):
  } [512 bytes data]
  * TLSv1.3 (IN), TLS handshake, Server hello (2):
  { [122 bytes data]
  * TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
  { [19 bytes data]
  * TLSv1.3 (IN), TLS handshake, Certificate (11):
  { [2218 bytes data]
  * TLSv1.3 (IN), TLS handshake, CERT verify (15):
  { [79 bytes data]
  * TLSv1.3 (IN), TLS handshake, Finished (20):
  { [52 bytes data]
  * TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):
  } [1 bytes data]
  * TLSv1.3 (OUT), TLS handshake, Finished (20):
  } [52 bytes data]
  * SSL connection using TLSv1.3 / TLS_AES_256_GCM_SHA384
  * ALPN, server accepted to use h2
  * Server certificate:
  *  subject: C=[location]; O=Cloudflare, Inc.; CN=sni.cloudflaressl.com
  *  start date: Jul  8 00:00:00 2020 GMT
  *  expire date: Jul  8 12:00:00 2021 GMT
  *  subjectAltName: host &quot;www.example.com&quot; matched cert's &quot;www.example.com&quot;
  *  issuer: C=US; O=Cloudflare, Inc.; CN=Cloudflare Inc ECC CA-3
  *  SSL certificate verify ok.
  * Using HTTP2, server supports multi-use
  * Connection state changed (HTTP/2 confirmed)
  * Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
  } [5 bytes data]
  * Using Stream ID: 1 (easy handle 0x2552070)
  } [5 bytes data]
  &gt; POST /example.php HTTP/2
  &gt; Host: www.example.com
  &gt; user-agent: curl/7.70.0
  &gt; accept: */*
  &gt; content-type: application/json
  &gt;
  { [5 bytes data]
  * TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
  { [230 bytes data]
  * TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
  { [230 bytes data]
  * old SSL session ID is stale, removing
  { [5 bytes data]
  * Connection state changed (MAX_CONCURRENT_STREAMS == 256)!
  } [5 bytes data]
    0     0    0     0    0     0      0      0 --:--:--  0:00:01 --:--:--     0&lt; HTTP/2 400
  &lt; date: Mon, 20 Jul 2020 20:10:07 GMT
  &lt; content-type: text/html; charset=UTF-8
  &lt; set-cookie: __cfduid=dbb003aa8db90cc84daebeb59f5c0f40f1595275806; expires=Wed, 19-Aug-20 20:10:06 GMT; path=/; domain=.example.com; HttpOnly; SameSite=Lax; Secure
  &lt; x-robots-tag: noindex
  &lt; expires: Wed, 11 Jan 1984 05:00:00 GMT
  &lt; cache-control: no-cache, must-revalidate, max-age=0
  &lt; vary: User-Agent,Accept-Encoding
  &lt; cf-cache-status: DYNAMIC
  &lt; cf-request-id: 040f721f0c0000c1cf91808200000001
  &lt; expect-ct: max-age=604800, report-uri=&quot;https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct&quot;
  &lt; server: cloudflare
  &lt; cf-ray: 5b5f52de7aedc1cf-IAD
  &lt;
  { [1 bytes data]
  100     1    0     1    0     0      0      0 --:--:--  0:00:01 --:--:--     30
  * Connection #1 to host www.example.com left intact
  </code></pre>