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

Not Getting data for fixtures by date #135

Closed
oyeleyemustapha opened this issue Dec 6, 2022 · 6 comments
Closed

Not Getting data for fixtures by date #135

oyeleyemustapha opened this issue Dec 6, 2022 · 6 comments

Comments

@oyeleyemustapha
Copy link

We currently use the api to get matches per day until recently we noticed we are not getting data for fixtures by date anymore.

@PeppoDev
Copy link

PeppoDev commented Dec 6, 2022

Seems to be a unexpected response when you don't send the Content-type: application/json inside the header.

If we are working on node should be something like:

const axios = require('axios');

const response = await axios.post(
    'http://api.cup2022.ir/api/v1/bydate',
    {
        'date': '12/2/2022'
    },
    {
        headers: {
            'Authorization': 'Bearer {your_token_goes_here}',
            'Content-Type': 'application/json'
        }
    }
);

We can use the curl version in order to convert to other language as you wish in this site

@oyeleyemustapha
Copy link
Author

The Content-Type was added to the header when making the calls yet we don't get response for matches based on date.

'http://api.cup2022.ir/api/v1/bydate', CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => '', CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_POSTFIELDS =>'{ "date": "12/06/2022" }', CURLOPT_HTTPHEADER => array( ': ', 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiI2MzdjNGFkODQ4NzA5MjMzZmQ4NWM3OGYiLCJpYXQiOjE2NzA0MTQ1NzAsImV4cCI6MTY3MDUwMDk3MH0.V9yY7CxuptQKgRBaMlDGiz8zRLYc2cOlW8r0P-0uKkc', 'Content-Type: application/json' ), )); $response = curl_exec($curl); curl_close($curl); echo $response;

@rezarahiminia
Copy link
Owner

rezarahiminia commented Dec 7, 2022 via email

@oyeleyemustapha
Copy link
Author

not getting any data for {
"date":"12/7/2022"
}

@rezarahiminia
Copy link
Owner

rezarahiminia commented Dec 7, 2022 via email

@oyeleyemustapha
Copy link
Author

Thank you for yout help.

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

No branches or pull requests

3 participants