Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

oauth1 PUT requests doesnt work #1214

Open
dimagoltsman opened this issue Dec 22, 2023 · 5 comments
Open

oauth1 PUT requests doesnt work #1214

dimagoltsman opened this issue Dec 22, 2023 · 5 comments

Comments

@dimagoltsman
Copy link

dimagoltsman commented Dec 22, 2023

What are you attempting to do
send PUT requests to twitter api

Expected behavior
to work

Actual behavior
server error 500

Code example

$params = [
                    'title' => 'My test Stream',
                    "locale" => 'en_US',
                    "should_not_tweet" => false,
                    "state" => "PUBLISH"
                ];
$res = $connection->put("users/$user_id/broadcasts/$id/state", $params, true);
            

Versions:

  • TwitterOAuth: latest
  • PHP: v8.0

Additional context
same request with native oauth.so in php, works.
i think something is wrong with the encryption of PUT requests

@abraham
Copy link
Owner

abraham commented Jan 2, 2024

server error 500

You need to enable server debugging and find out why there is a 500 error.

@dimagoltsman
Copy link
Author

server error 500

You need to enable server debugging and find out why there is a 500 error.

it is because the request is not probably encoded correcttly. using php oauth.so to make the same request works.

@abraham
Copy link
Owner

abraham commented Feb 18, 2024

I don't know what that means.

@dimagoltsman
Copy link
Author

Try s3nding any "put" request with the lib. It does not work.

@abraham
Copy link
Owner

abraham commented Feb 18, 2024

Oh. I suppose that's possible. Twitter got rid of all the put requests years ago.

Image

PUT looks like it's handled the same as a POST for how it's constructued. You could try playing around with that and see you can get something to work. I have no access to the Twitter API anymore and will not be able to try anything.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants