Hello Twitter developer:
I’m experiencing a problem now, and there are two applications that use Unity Twitter’s picture sharing function. But now one of the apps on iOS share function is invalid but Android is normal, iOS and Android twitterKey and twitterSecret are the same, and the following error is returned:
2019-12-25 15:46:52.470815+0800[1013:1408628] Did encounter error sending Tweet: Error Domain=TWTRNetworkingErrorDomain Code=-1011 “Request failed: client error (431)” UserInfo={NSLocalizedFailureReason=, TWTRNetworkingStatusCode=431, NSErrorFailingURLKey=https://api.twitter.com/1.1/statuses/update.json, NSLocalizedDescription=Request failed: client error (431)}
Now I replaced twitterKey and twitterSecret with another app, and the iOS sharing was successful. May i know what is this all about? @TwitterDev
This is strange because 431 error is “Request Header Fields Too Large”, are you maybe including other headers apart from OAuth? how large is the request? What endpoint are you using for picture sharing? is it POST media/upload | Docs | Twitter Developer Platform or Chunked upload?
I used to think that the image size was limited. But now even if I don’t post image, just write a word, the post will fail. please help!
I’m not sure what is happening here, but I can tell you that TwitterKit is no longer supported (and has not been supported for 18 months), so you’re using a framework that we are unable to offer suggestions about.
Are you able to describe what the API error response code is here? Are you still seeing HTTP 431?
Are you able to post to the API with the same consumer key and secret for your app from the command line, e.g. using twurl?
thank you for your reply.
Yes,I still seeing HTTP 431. if TwitterKit is no longer supported, please give me a new SDK address or API information.
I replaced twitterKey and twitterSecret with another app, then the iOS sharing was successful and No changes to the code.