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

Add Support for Additional Response Content-Types #8708

Closed
alzimmermsft opened this issue Mar 4, 2020 · 5 comments · Fixed by #32277
Closed

Add Support for Additional Response Content-Types #8708

alzimmermsft opened this issue Mar 4, 2020 · 5 comments · Fixed by #32277
Assignees
Labels
Azure.Core azure-core Client This issue points to a problem in the data-plane of the library.

Comments

@alzimmermsft
Copy link
Member

Currently, Azure Core expects that the Content-Type of a response is either json or xml. There are additional Content-Types that need to be supported such as plain text, images, and additional forms of json or xml that aren't currently supported.

@alzimmermsft alzimmermsft added the Azure.Core azure-core label Mar 4, 2020
@alzimmermsft alzimmermsft self-assigned this Mar 4, 2020
@alzimmermsft
Copy link
Member Author

Azure Search uses text/plain

@lmazuel
Copy link
Member

lmazuel commented Mar 4, 2020

AppConfig could use application/vnd.microsoft.appconfig.kv.v1+json if that helps

@lmazuel
Copy link
Member

lmazuel commented Mar 4, 2020

If that could helps, some notes on what Python is doing:

  • When you call the pipeline, you pass a parameter to say if you want the pipeline to "pre-deserialize" the body (stream=True/False):
    • If you pass stream=True, pipeline doesn't touch the body and give you back an open socket on the HTTP connection (e.g. download blob). Content-Type is ignored.
    • If you do pass stream=False, this means load the body in memory, and use the Content-Type to do a first pass:
      • If regexp match JSON, create the JSON object
      • Else if XML, create a XML tree
      • Else if text/*, decode the body and return the string
      • Else fail for content-type impossible to handle

@weidongxu-microsoft
Copy link
Member

mgmt-plane got response as application/json 99.9%.

automation has a text/powershell.
https://github.com/Azure/azure-rest-api-specs/blob/master/specification/automation/resource-manager/Microsoft.Automation/stable/2018-06-30/runbook.json#L54-L91

I think at present modelerfour will parse this as binary, so we are still safe.

@alzimmermsft
Copy link
Member Author

This issue may be broken out into smaller children issues per Content-Type needing support.

@alzimmermsft alzimmermsft added the Client This issue points to a problem in the data-plane of the library. label Jul 15, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Apr 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Azure.Core azure-core Client This issue points to a problem in the data-plane of the library.
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants