title: 412 Response on second request to Github
body: <p>I'm getting some very strange behavior using AFNetworking 2.0 to access the Github API. The first time I make an API request to this end point <a href="http://developer.github.com/v3/oauth/#get-or-create-an-authorization-for-a-specific-app" rel="nofollow">http://developer.github.com/v3/oauth/#get-or-create-an-authorization-for-a-specific-app</a> to get the OAuth token, it comes back with a 200 or 201 response like it should. If I quit the application and try again, the request comes back with a 412 response, even though the requests are identical. I have not been able to reproduce this using curl. I'll paste the requests and responses here.</p>
  
  <p>Request response 1 that passes</p>
  
  <pre><code>PUT 'https://api.github.com/authorizations/clients/a162f34fd261c382b59d': {
      "Accept-Language" = "en;q=1, fr;q=0.9, de;q=0.8, zh-Hans;q=0.7, zh-Hant;q=0.6, ja;q=0.5";
      Authorization = "Basic ****************************";
      "Content-Type" = "application/json; charset=utf-8";
      "User-Agent" = "Staticly/1.0 (iPad Simulator; iOS 7.0.3; Scale/1.00)";
  } {"client_secret":"*****************************","scope":["repo"]}
  
  2014-01-08 10:43:26.313 Staticly[6035:70b] PUT 'https://api.github.com/authorizations/clients/a162f34fd261c382b59d': {
      "Accept-Language" = "en;q=1, fr;q=0.9, de;q=0.8, zh-Hans;q=0.7, zh-Hant;q=0.6, ja;q=0.5";
      Authorization = "Basic **************************";
      "Content-Type" = "application/json; charset=utf-8";
      "User-Agent" = "Staticly/1.0 (iPad Simulator; iOS 7.0.3; Scale/1.00)";
  } {"client_secret":"*******************************","scope":["repo"]}
  2014-01-08 10:43:26.364 Staticly[6035:70b] 200 'https://api.github.com/authorizations/clients/a162f34fd261c382b59d' [0.0510 s]: {
      "Access-Control-Allow-Credentials" = true;
      "Access-Control-Allow-Origin" = "*";
      "Access-Control-Expose-Headers" = "ETag, Link, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval";
      "Cache-Control" = "private, max-age=60, s-maxage=60";
      "Content-Encoding" = gzip;
      "Content-Type" = "application/json; charset=utf-8";
      Date = "Wed, 08 Jan 2014 15:43:24 GMT";
      Etag = "\"257ff8977266fd375142f862e0536b53\"";
      Server = "GitHub.com";
      Status = "200 OK";
      "Transfer-Encoding" = Identity;
      Vary = "Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding";
      "X-Content-Type-Options" = nosniff;
      "X-GitHub-Media-Type" = "github.beta";
      "X-GitHub-Request-Id" = "633B6CDC:6F7C:9F9595F:52CD721C";
      "X-RateLimit-Limit" = 5000;
      "X-RateLimit-Remaining" = 4985;
      "X-RateLimit-Reset" = 1389198563;
  } (null)
  </code></pre>
  
  <p>Request response 2 that fails</p>
  
  <pre><code>PUT 'https://api.github.com/authorizations/clients/a162f34fd261c382b59d': {
      "Accept-Language" = "en;q=1, fr;q=0.9, de;q=0.8, zh-Hans;q=0.7, zh-Hant;q=0.6, ja;q=0.5";
      Authorization = "Basic *********************";
      "Content-Type" = "application/json; charset=utf-8";
      "User-Agent" = "Staticly/1.0 (iPad Simulator; iOS 7.0.3; Scale/1.00)";
  } {"client_secret":"************************","scope":["repo"]}
  
  2014-01-08 10:45:39.187 Staticly[6078:70b] PUT 'https://api.github.com/authorizations/clients/a162f34fd261c382b59d': {
      "Accept-Language" = "en;q=1, fr;q=0.9, de;q=0.8, zh-Hans;q=0.7, zh-Hant;q=0.6, ja;q=0.5";
      Authorization = "Basic ***************************";
      "Content-Type" = "application/json; charset=utf-8";
      "User-Agent" = "Staticly/1.0 (iPad Simulator; iOS 7.0.3; Scale/1.00)";
  } {"client_secret":"*************************","scope":["repo"]}
  2014-01-08 10:45:39.188 Staticly[6078:70b] 412 'https://api.github.com/authorizations/clients/a162f34fd261c382b59d' [0.0018 s]: {
      "Access-Control-Allow-Credentials" = true;
      "Access-Control-Allow-Origin" = "*";
      "Access-Control-Expose-Headers" = "ETag, Link, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval";
      "Cache-Control" = "private, max-age=60, s-maxage=60";
      "Content-Type" = "text/html;charset=utf-8";
      Date = "Wed, 08 Jan 2014 15:45:37 GMT";
      Etag = "\"257ff8977266fd375142f862e0536b53\"";
      Server = "GitHub.com";
      Status = "412 Precondition Failed";
      "Transfer-Encoding" = Identity;
      "X-Content-Type-Options" = nosniff;
      "X-GitHub-Request-Id" = "633B6CDC:6F7A:91EF162:52CD72A1";
      "X-RateLimit-Limit" = 5000;
      "X-RateLimit-Remaining" = 4983;
      "X-RateLimit-Reset" = 1389198563;
  } (null)
  </code></pre>