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

Change/Extend the OC Client to perform GET instead of POST when requesting one component #342

Closed
i-b-dimitrov opened this issue Jan 4, 2017 · 1 comment

Comments

@i-b-dimitrov
Copy link
Contributor

That's in connection with the custom headers introduced recently.
In order to benefit from any intermediate caches we need to perform GET requests (component by component). In case of bulk requests we can still go with POST but in case the microsite is built to anticipate it then doing only GET requests with the the appropriate caching could bring a log of speed and offload the registry.

So the general idea is either to:

  • change the OC Client so that invoking renderComponent(...) will trigger a GET request
    or
  • introduce a new method renderComponentGet(...) to do this.
@matteofigus
Copy link
Member

I'm ok with doing get for renderComponent() - the underlining request type should be of no interest for the consumer and shouldn't break any existing contract ;)

In case of the POST, perhaps as a separate PR for a future issue, I think it would be still nice to get the same capability by extending the response:

[{
  status: 200,
  response: ...,
  headers: ...
}]

i-b-dimitrov added a commit to i-b-dimitrov/oc that referenced this issue Jan 11, 2017
…ust one component (opencomponents#342)

Also:
- Extended get-components-data error handling to anticipate a flat response
  with a single error field when a major 4xx error is detected for the request.
  In this case we extend the error message to provide as much data as possible.
- Added more tests and fixed the existing ones.
i-b-dimitrov added a commit to i-b-dimitrov/oc that referenced this issue Jan 16, 2017
…ust one component (opencomponents#342)

Also:
- Extended get-components-data error handling to anticipate a flat response
  with a single error field when a major 4xx error is detected for the request.
  In this case we extend the error message to provide as much data as possible.
- Added more tests and fixed the existing ones.
i-b-dimitrov added a commit to i-b-dimitrov/oc that referenced this issue Jan 18, 2017
…ust one component (opencomponents#342)

Also:
- Extended get-components-data error handling to anticipate a flat response
  with a single error field when a major 4xx error is detected for the request.
  In this case we extend the error message to provide as much data as possible.
- Added more tests and fixed the existing ones.
i-b-dimitrov added a commit to i-b-dimitrov/oc that referenced this issue Feb 9, 2017
…ust one component (opencomponents#342)

Also:
- Extended get-components-data error handling to anticipate a flat response
  with a single error field when a major 4xx error is detected for the request.
  In this case we extend the error message to provide as much data as possible.
- Added more tests and fixed the existing ones.
i-b-dimitrov added a commit to i-b-dimitrov/oc that referenced this issue Feb 16, 2017
…ust one component (opencomponents#342)

Also:
- Extended get-components-data error handling to anticipate a flat response
  with a single error field when a major 4xx error is detected for the request.
  In this case we extend the error message to provide as much data as possible.
- Added more tests and fixed the existing ones.
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

2 participants