Skip to content

Conversation

@ellen2212
Copy link

I think it is better for developer to allow custom data type while sending a request.
so could you merge it and release. what do your think? @StefH @Sir-J

@Sir-J
Copy link
Contributor

Sir-J commented May 19, 2020

So ... I saw this PR. I think it's a very strange solution. If I right understand, you want to send custom data on Post and get another type of data?

@ellen2212
Copy link
Author

Yes.we just want to send a request with content-type: 'application/json'.not 'Content-Type: text/plain'.Is it strange?

@Sir-J
Copy link
Contributor

Sir-J commented May 19, 2020

Because in your PR you don't change the logic. Early was:
JSON.stringify(this.entity)
you changed it to:
this.config.extractRequestDataFormat(this.entity)
but this function return JSON.stringify(data). Where data it's this.entity
What did you change?

@ellen2212
Copy link
Author

ellen2212 commented May 27, 2020

Because in your PR you don't change the logic. Early was:
JSON.stringify(this.entity)
you changed it to:
this.config.extractRequestDataFormat(this.entity)
but this function return JSON.stringify(data). Where data it's this.entity
What did you change?

I think the developers can redefine the extractRequestDataFormat by extends ODataConfiguration.like configure the baseUrl,defaultRequestOptions and so on.The developers can configure the baseUrl, extractQueryResultData(), even getEntityUri(). I think it is a great way to configure requestBody like this.@Sir-J

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

Successfully merging this pull request may close these issues.

2 participants