Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

POST parameter encoding #40

Open
mbtaylor opened this issue Aug 8, 2024 · 2 comments
Open

POST parameter encoding #40

mbtaylor opened this issue Aug 8, 2024 · 2 comments

Comments

@mbtaylor
Copy link
Member

mbtaylor commented Aug 8, 2024

DALI section 4 lists a number of parameters and talks about submitting them to service endpoints, but I don't see anywhere it explicitly says, in general, how these must be encoded.

With GET as far as I know the only way to do it is using application/x-www-form-urlencoded in the query part of the URL (http://example.com?a=b&c=d) - though I don't know where in the standardsverse that practice is defined - so I guess that doesn't need to be said.

But for POST there are at least two options, application/x-www-form-urlencoded and multipart/form-data (for one definition of these see HTML 4.01 sec 17.13.4.1).

DALI sec 4.3.5 UPLOAD says that for inline uploads you have to use multipart/form-data. Some of the examples (e.g. sec 5.2 Synchronous Query) seem to show an ad-hoc(?) encoding that puts a name=value on each line without any encoding of spaces (I don't know whether this is literally intended/required to work, or whether it's just illustrative of the values). But other than that, I can't see instructions about POSTed parameter encoding in DALI or TAP.

Most TAP services seem to accept both multipart/form-data and application/x-www-form-urlencoded wherever parameters are POSTed. But I just encountered one that doesn't, and I don't know whether it is actually in violation of DALI/TAP or not.

So: should we add a note at the start of Section 4 saying that services are required to accept POSTed parameters in both application/x-www-form-urlencoded and multipart/form-data encodings?

@msdemlei
Copy link
Contributor

msdemlei commented Aug 8, 2024 via email

@pdowler
Copy link
Collaborator

pdowler commented Aug 8, 2024

Agreed.

In principle a single POST should be able to completely create a TAP job, including multiple params and multiple inline table uploads (!). If/when we have other APIs with a mix of params and inline content, they will also need to make sure multipart/form-data works.

! I'm not 100% certain that CADC TAP services actually accept multiple inline content, but if not it's a bug; the intent is that they do.

We may need to soften the language about content-type further, depending on P3T outcomes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants