husnjak / IGDB-API-JVM

Wrapper for IGDBs API written in Kotlin should work for all JVM based languages, tested in Kotlin & Java
MIT License
37 stars 10 forks source link

Request Error #6

Closed ChewbaccaA0 closed 3 years ago

ChewbaccaA0 commented 4 years ago

Hey, I always get a RequestError when using the template from the Wiki. https://hasteb.in/onimahey.gradle (I replaced my key, so it's not public, obviously.)

Status code 403.

Why?

husnjak commented 4 years ago

I can't seem to replicate your issue, using the exact same code in a new project it works for me. Getting a 403 is also weird, can you try replicating the query in Postman?

Also can you get me the Detailed error message, might help me understand what went wrong ((Result.Failure) error.result).error.detailMessage

ChewbaccaA0 commented 4 years ago

Maybe it's because I didn't specify the subURL /games in any way? I can't seem to recreate your line of code you send me for the detailMessage.

Postman works, the only issue with that program is that I don't know how to transmit a json xD

iserb commented 3 years ago

Got same error on simplest request. Debug Request:

--> POST https://api.igdb.com/v4/games.pb
Body : fields name; limit 10; search "dead";
Headers : (4)
client-id : xxh********************z7
Content-Type : text/plain; charset=UTF-8
authorization : Bearer ite***********************zu
x-user-agent : igdb-api-jvm

Debug Response:

<-- 403 https://api.igdb.com/v4/games.pb
Response : Forbidden
Length : 16
Body : error code: 1010
Headers : (14)
Cache-Control : private, max-age=0, no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Set-Cookie : __cfduid=dcec85f680610eec02507a4899bd9bad81613565803; expires=Fri, 19-Mar-21 12:43:23 GMT; path=/; domain=.igdb.com; HttpOnly; SameSite=Lax; Secure
CF-RAY : 622f98027dbb168d-ARN
Expect-CT : max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
X-Frame-Options : SAMEORIGIN
Connection : keep-alive
Strict-Transport-Security : max-age=15552000; includeSubDomains; preload
Date : Wed, 17 Feb 2021 12:43:23 GMT
cf-request-id : 08519d558e0000168dfc9ef000000001
Server : cloudflare
Expires : Thu, 01 Jan 1970 00:00:01 GMT
X-Content-Type-Options : nosniff
Content-Type : text/plain; charset=UTF-8
Content-Length : 16

The postman works as a charm, the Java code does not :(

husnjak commented 3 years ago

I still cannot replicate this issue. The response body error is referring to CloudFlare and means Banned 😕. I still cannot reproduce this issue but I will take a look at this cloudflare issue