SportScore

FREEMIUM
Verified
От Tipsters CO | Обновлено vor 10 Tagen | Sports
Популярность

9.9 / 10

Задержка

127ms

Уровень обслуживания

100%

Health Check

100%

Назад ко всем обсуждениям

POST request not working

Rapid account: Cedk
cedk
vor 2 Jahren

Hi, today the POST request /teams/search?sport_id=3&country=France is not working (using CURL in PHP).

I don’t understand why the response is a HTTP/1.1 400 Bad Request.


Trying 3.226.33.234:443…

  • Connected to sportscore1.p.rapidapi.com (3.226.33.234) port 443 (#0)
  • ALPN, offering http/1.1
  • SSL connection using TLSv1.2 / ECDHE-RSA-AES128-GCM-SHA256
  • ALPN, server accepted to use http/1.1
  • Server certificate:
  • subject: CN=*.p.rapidapi.com
  • start date: Jul 6 00:00:00 2022 GMT
  • expire date: Aug 4 23:59:59 2023 GMT
  • subjectAltName: host “sportscore1.p.rapidapi.com” matched cert’s “*.p.rapidapi.com”
  • issuer: C=US; O=Amazon; OU=Server CA 1B; CN=Amazon
  • SSL certificate verify ok.

POST /teams/search?sport_id=3&country=France HTTP/1.1
Host: sportscore1.p.rapidapi.com
Accept: /
Accept-Encoding: deflate, gzip, br
X-RapidAPI-Host: sportscore1.p.rapidapi.com
X-RapidAPI-Key: ****

  • Mark bundle as not supporting multiuse
    < HTTP/1.1 400 Bad Request
    < Date: Wed, 17 Aug 2022 11:10:53 GMT
    < Content-Type: text/plain; charset=UTF-8
    < Transfer-Encoding: chunked
    < Connection: keep-alive
    < X-RateLimit-Requests-Limit: 500
    < X-RateLimit-Requests-Remaining: 301
    < X-RateLimit-Requests-Reset: 187629
    < Server: RapidAPI-1.2.8
    < X-RapidAPI-Version: 1.2.8
    < X-RapidAPI-Region: AWS - us-east-1
    <
  • Connection #0 to host sportscore1.p.rapidapi.com left intact
    string(0) “”
Rapid account: Donald Steve
DonaldSteve Commented vor 6 Monaten

FINALLY I GOT MY LOST BITCOIN BACK FROM SCAMMERS: Hello, I wilI highly recommend the services of hackersteve911 to anyone who wishes to recover their lost money either bitcoin or other cryptocurrencies from these online scammers, wallet hackers, or if you ever sent bitcoins to the wrong wallet address. I was able to recover my lost bitcoins from online swindlers in less than 24 hours after contacting them. They are the best professional hackers out there and I’m truly thankful for their help in recovering all I lost. If you need their service too, here is their contact information: hackersteve911@gmail.com

Rapid account: Tipsters
tipsters Commented vor 2 Jahren

ok!

Rapid account: Cedk
cedk Commented vor 2 Jahren

OK I found the problem.

The example code is incorrect, the post data must be passed as a query string in the CURLOPT_POSTFIELDS field, not in the enpoint URL as suggested.

<?php

$curl = curl_init();

$data = [
	'sport_id' => 3,
	'country' => 'France'
];

$post_data = http_build_query($data);

curl_setopt_array($curl, [
	CURLOPT_URL => "https://sportscore1.p.rapidapi.com/players/search",
	CURLOPT_RETURNTRANSFER => true,
	CURLOPT_FOLLOWLOCATION => true,
	CURLOPT_ENCODING => "",
	CURLOPT_MAXREDIRS => 10,
	CURLOPT_TIMEOUT => 30,
	CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
	CURLOPT_CUSTOMREQUEST => "POST",
	CURLOPT_HTTPHEADER => [
		"X-RapidAPI-Host: sportscore1.p.rapidapi.com",
		"X-RapidAPI-Key: ***"
	],
	CURLOPT_POSTFIELDS => $post_data
]);

$response = curl_exec($curl);
$err = curl_error($curl);
$info = curl_getinfo($curl, CURLINFO_HTTP_CODE);

var_dump('info', $info);
var_dump('response', $response);
var_dump('err', $err);

curl_close($curl);


Присоединяйтесь к обсуждению – добавьте комментарий ниже:

Войдите / Зарегистрируйтесь, чтобы публиковать новые комментарии