Git Product home page Git Product logo

Comments (8)

cyle avatar cyle commented on June 18, 2024 1

Docs have been updated in the latest commit to explicitly mention how Content-Type headers are expected to work: c08e8e9

Thanks again for raising this issue, and sorry it was confusing!

from docs.

AprilSylph avatar AprilSylph commented on June 18, 2024

The web client uses form data as the first example shows... are you maybe omitting Content-Type: application/x-www-form-urlencoded; charset=UTF-8 in the request headers?

from docs.

StillLynnTheCloset avatar StillLynnTheCloset commented on June 18, 2024

Ah, that's where the disconnect is, I'm implementing a client library, so I'm expecting API calls to be a standard post request.
If the web client uses a different request format, that should probably be documented on the web client documentation and not in the standard API documentation with all of the other JSON based APIs .

from docs.

cyle avatar cyle commented on June 18, 2024

Hello! Thanks for pointing this out. @AprilSylph is correct: this endpoint expects Content-Type: application/x-www-form-urlencoded, not Content-Type: application/json. Most of the Tumblr API endpoints can accept either, but in some cases, like creating NPF posts, they can only accept one format. We'll update the documentation to make this clearer.

from docs.

StillLynnTheCloset avatar StillLynnTheCloset commented on June 18, 2024

But the API currently does support application/json requests for POST, GET, and DELETE, is that unintentional functionality that will be removed?

from docs.

cyle avatar cyle commented on June 18, 2024

But the API currently does support application/json requests for POST, GET, and DELETE, is that unintentional functionality that will be removed?

No, definitely not. I just meant that we'll be clarifying these different acceptable Content-Type headers -- application/json is one of them. 👌 The core problem I think you've uncovered is that not providing the header at all can lead to unexpected behavior, as you saw.

from docs.

StillLynnTheCloset avatar StillLynnTheCloset commented on June 18, 2024

Actually, I always provided a header, but for my first attempts it was text/plain.

I'll update my PR to show both.

from docs.

cyle avatar cyle commented on June 18, 2024

We'll be pushing an update to the docs soon with a new top level section on valid Content-Type values across all endpoints that expect body parameters.

from docs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.