angular-odata-es5 icon indicating copy to clipboard operation
angular-odata-es5 copied to clipboard

allow custom data type while sending a request.

Open ellen2212 opened this issue 5 years ago • 4 comments

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

ellen2212 avatar May 19 '20 01:05 ellen2212

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?

Sir-J avatar May 19 '20 03:05 Sir-J

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

ellen2212 avatar May 19 '20 06:05 ellen2212

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?

Sir-J avatar May 19 '20 06:05 Sir-J

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

ellen2212 avatar May 27 '20 06:05 ellen2212