Time |
S |
Nick |
Message |
07:54 |
|
|
Haudegen joined #rest |
12:20 |
|
|
Haudegen joined #rest |
14:36 |
|
|
Haudegen joined #rest |
15:55 |
|
|
PrashantJ joined #rest |
15:55 |
|
|
PrashantJ left #rest |
17:42 |
|
|
Haudegen joined #rest |
17:49 |
|
|
wsieroci joined #rest |
20:45 |
|
|
saml joined #rest |
20:45 |
|
saml |
hello web scalers |
20:46 |
|
saml |
GET /foo is proxy of /bar. how do I implement this? 3xx? API contract is GET /foo to return 200 Ok with same representation of /bar |
20:46 |
|
saml |
so, I want to avoid 3xx if possible |
22:24 |
|
whartung |
not sure if I understand completely saml |
22:28 |
|
impl |
saml: you can add a HTTP Link header? Link: <http://yourapi/bar>; rel="canonical" |
22:32 |
|
whartung |
what are the semantics of hte link header? |
22:34 |
|
impl |
https://tools.ietf.org/html/rfc8288#section-2 |
22:35 |
|
impl |
it's basically the same as the HTML <link> tag |
22:36 |
|
whartung |
do you think that manifests as a proxy, as saml mentioned originally? |
22:36 |
|
whartung |
My question is what he means by “proxy” |
22:37 |
|
impl |
yeah - i assumed he didn't mean a literal reverse proxy but rather returned the same content at an alternate URI |
22:37 |
|
whartung |
that’s the way I interpret it, and in that case the 3xx doesn’t really apply (as 3xx is not the “same content”) |
22:37 |
|
whartung |
IMHO |
22:38 |
|
impl |
yeah, i would return 200 with the Link header |
22:38 |
|
|
Haudegen joined #rest |
22:38 |
|
whartung |
I woul djust returnt the conent, I’d map the URL in the routing layer |
22:38 |
|
saml |
i guess my actual question is if a resource has multiple urls, what do I do? redirect to canonical url? |
22:39 |
|
saml |
or does it even matter? |
22:39 |
|
whartung |
Yea, I think impls idea of returning the link header, but I’d also return the original content. |
22:39 |
|
whartung |
depends on your motivation for the proxy — why is it there at all why does a resource have two names? |
22:39 |
|
impl |
yeah - to be clear, I meant 200 with the content, and not e.g. 204 and only the link header. |
22:40 |
|
saml |
let's say GET /foo actually downloads something from S3 (amazon storage thingy) and serves it |
22:40 |
|
saml |
GET /foo GET /bar may download the same object from S3 |
22:40 |
|
whartung |
first, I as a client “don’t care” what you as a server do, right? How you’re sending me the content. |
22:40 |
|
saml |
so, I was wondering if it's simpler just to have GET /foo redirect |
22:41 |
|
whartung |
flat file, s3, db, etc. |
22:41 |
|
saml |
right |
22:41 |
|
whartung |
well the advantage of the redirect is that s3 is taking the bandwidth hit. |
22:41 |
|
saml |
that's true |
22:41 |
|
whartung |
and, it’s a good question abou tthe semantics of a temporary redirect |
22:42 |
|
whartung |
if you use a temp redirect, you don’t “rename” the resource, per se, right? |
22:42 |
|
whartung |
so I think that would be ok, actually. |
22:42 |
|
whartung |
a permanent redirect I consider more of a “this name is wrong, use this new one" |
22:42 |
|
saml |
hrm thanks. i'll think about this on the bus |
22:47 |
|
whartung |
here ya go |
22:47 |
|
whartung |
10.3.6 305 Use Proxy |
22:47 |
|
whartung |
The requested resource MUST be accessed through the proxy given by |
22:47 |
|
whartung |
the Location field. |
23:51 |
|
|
tellnes joined #rest |