I’m toying about with writing a client in Rust.

Example code online uses the API endpoint https://lemmy.ml/api/v3/post/list, and when I go to this link in a browser, it doe indeed load data. However, when I try to load it from a program, it gives me a 403 Forbidden. Does anyone know why this could be?

(code)

  • Saganaki@lemmy.one
    link
    fedilink
    English
    arrow-up
    1
    arrow-down
    2
    ·
    1 year ago

    I know very little about Lemmy specifically, but 403 generally means you’re not auth’d or don’t have permission.

    Do you need to set an auth header perhaps? Your best bet would be to bring up browser dev tools and see what request the working browser is doing.