Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Pei Yuecheng
    @yueCheng_gitlab
    Hi, I'm a college student who is using your API to do a coursework. I'm using JAVA, but I failed to get response from your server(403), although my url is correct and can get correct response in browser(I use right API and token). Here question is your API just support Python, not JAVA ? Looking for your reply, thank you in advance.
    Pei Yuecheng
    @yueCheng_gitlab
    Emm... I don't understand the diffrence between using a kind of programming language and using browser(or Postman) to invoke API, in my personal perspective, both ways are using the same url ,the same endpoint. Can you give any idea about this ? Sorry to disturb you.
    Subhash Ramesh
    @thecooltechguy
    Hi @yueCheng_gitlab , nice to meet you! Our REST API can be accessed from any programming language, not just Python. Could you share some of the Java code you're using, so that I can see why it's not working? Thanks! :D
    Pei Yuecheng
    @yueCheng_gitlab
    image.png
    image.png
    403 Unauthorized access
    Subhash Ramesh
    @thecooltechguy
    Oh ok, thanks for the info. I'll go ahead and look at it now.
    Pei Yuecheng
    @yueCheng_gitlab
    but this url is perfect in browser
    Subhash Ramesh
    @thecooltechguy
    yup, I just tried and it works in the browser. Let me try in Java now
    Pei Yuecheng
    @yueCheng_gitlab
    thank you in advance
    I'm struggling here
    it's 02:01 am now haha
    Subhash Ramesh
    @thecooltechguy
    Of course, happy to help! :D Sorry to hear that you're facing this issue! I'm debugging it now
    Hey, can you try using HttpsURLConnection instead of HttpURLConnection?
    Pei Yuecheng
    @yueCheng_gitlab
    alright I'm trying
    Subhash Ramesh
    @thecooltechguy
    ok cool, let me know how it goes
    Subhash Ramesh
    @thecooltechguy
    Hey @yueCheng_gitlab , I've solved the issue! Just insert the following line of code after you call connection.setRequestMethod("GET"): connection.addRequestProperty("User-Agent", "Mozilla/4.0");
    This will work
    you can actually continue to use HttpURLConnection
    Pei Yuecheng
    @yueCheng_gitlab
    It's a kind of "cross domain request" problem, right?not sure. now its can connect to your API, but I get empty response, no data. I'm still trying to work out this problem
    Subhash Ramesh
    @thecooltechguy
    Try running the Java code in this interactive console: https://repl.it/@subbytech/Galiboo-API-Java-example?language=java
    Pei Yuecheng
    @yueCheng_gitlab
    thanks for your patience, really thank you
    Subhash Ramesh
    @thecooltechguy
    Of course! When you run the code above, you'll see the API response correctly
    Pei Yuecheng
    @yueCheng_gitlab
    image.png
    Subhash Ramesh
    @thecooltechguy
    Sorry, wrong link! I edited the answer
    Pei Yuecheng
    @yueCheng_gitlab
    haha
    Subhash Ramesh
    @thecooltechguy
    woops haha
    Pei Yuecheng
    @yueCheng_gitlab
    image.png
    coooooooool
    you save my day!
    Subhash Ramesh
    @thecooltechguy
    Yay, it works! :D
    Of course man, happy to help!
    Pei Yuecheng
    @yueCheng_gitlab
    so the problem is in my side, not your server side
    sorry for that
    Subhash Ramesh
    @thecooltechguy
    No worries! As always, feel free to ask any questions and I'd be happy to help! :D
    Good luck with your coursework, have a great day (or early morning :D)!
    Pei Yuecheng
    @yueCheng_gitlab
    yep
    coooooooool!!!!
    Jay
    @13560175266_twitter
    hello
    i need api key