[jira] [Commented] (OLINGO-1332) Header Perfer: "return=minimal" or "return=representation" return Error "Prefer Header not supported"
[ https://issues.apache.org/jira/browse/OLINGO-1332?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16821410#comment-16821410 ] Jerome BAROTIN commented on OLINGO-1332: Thanks for the reply, the issue happened while querying my service with the .net "Simple.OData.Client" library. So from what I understand, the bug, is in this library. > Header Perfer: "return=minimal" or "return=representation" return Error > "Prefer Header not supported" > - > > Key: OLINGO-1332 > URL: https://issues.apache.org/jira/browse/OLINGO-1332 > Project: Olingo > Issue Type: Bug > Components: odata4-server >Affects Versions: (Java) V4 4.5.0 >Reporter: Jerome BAROTIN >Assignee: Michael Bolz >Priority: Major > Attachments: OLINGO-1332.patch > > > > Hi, > {color:#33}Considering the following python script :{color} > {code:java} > # -*- encoding: utf-8 -*- > import requests > headers = { > 'Content-Type': 'application/json', > 'Prefer': 'return=minimal' > } > url = "http://localhost:8080/Customers(2)" > r = requests.get(url, headers=headers)) > print(r.content){code} > If I run it on my olingo implementation, I've got the following content : > {noformat} > b'{"error":{"code":null,"message":"The Prefer header \'return=minimal\' is > not supported for this HTTP Method."}}'{noformat} > > > > > {color:#808080} {color} -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Updated] (OLINGO-1332) Header Perfer: "return=minimal" or "return=representation" return Error "Prefer Header not supported"
[ https://issues.apache.org/jira/browse/OLINGO-1332?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Michael Bolz updated OLINGO-1332: - Fix Version/s: (was: (Java) V4 4.6.0) > Header Perfer: "return=minimal" or "return=representation" return Error > "Prefer Header not supported" > - > > Key: OLINGO-1332 > URL: https://issues.apache.org/jira/browse/OLINGO-1332 > Project: Olingo > Issue Type: Bug > Components: odata4-server >Affects Versions: (Java) V4 4.5.0 >Reporter: Jerome BAROTIN >Assignee: Michael Bolz >Priority: Major > Attachments: OLINGO-1332.patch > > > > Hi, > {color:#33}Considering the following python script :{color} > {code:java} > # -*- encoding: utf-8 -*- > import requests > headers = { > 'Content-Type': 'application/json', > 'Prefer': 'return=minimal' > } > url = "http://localhost:8080/Customers(2)" > r = requests.get(url, headers=headers)) > print(r.content){code} > If I run it on my olingo implementation, I've got the following content : > {noformat} > b'{"error":{"code":null,"message":"The Prefer header \'return=minimal\' is > not supported for this HTTP Method."}}'{noformat} > > > > > {color:#808080} {color} -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (OLINGO-1332) Header Perfer: "return=minimal" or "return=representation" return Error "Prefer Header not supported"
[ https://issues.apache.org/jira/browse/OLINGO-1332?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16821398#comment-16821398 ] Michael Bolz commented on OLINGO-1332: -- Hello [~jbarotin], Sorry for the delay. However regarding your fix in OData V4 [8.2.8.7 Preference return=representation and return=minimal|http://docs.oasis-open.org/odata/odata/v4.0/errata03/os/complete/part1-protocol/odata-v4.0-errata03-os-part1-protocol-complete.html#_Toc453752234] it is defined that: {quote} In OData, return=representation or return=minimal is defined for use with a POST, PUT, or PATCH Data Modification Request other than to a stream property, or to an Action Request. Specifying a preference of return=representation or return=minimal in a GET or DELETE request, or any request to a stream property, SHOULD return a 4xx Client Error. {quote} So as I understand your case you receive an error if you add {{Prefer': 'return=minimal'}} in a {{GET}} HTTP request. If yes then this is the behaviour as defined in OData V4. If not please help me in explain your issue in more detail. Kind Regards, Michael > Header Perfer: "return=minimal" or "return=representation" return Error > "Prefer Header not supported" > - > > Key: OLINGO-1332 > URL: https://issues.apache.org/jira/browse/OLINGO-1332 > Project: Olingo > Issue Type: Bug > Components: odata4-server >Affects Versions: (Java) V4 4.5.0 >Reporter: Jerome BAROTIN >Assignee: Michael Bolz >Priority: Major > Fix For: (Java) V4 4.6.0 > > Attachments: OLINGO-1332.patch > > > > Hi, > {color:#33}Considering the following python script :{color} > {code:java} > # -*- encoding: utf-8 -*- > import requests > headers = { > 'Content-Type': 'application/json', > 'Prefer': 'return=minimal' > } > url = "http://localhost:8080/Customers(2)" > r = requests.get(url, headers=headers)) > print(r.content){code} > If I run it on my olingo implementation, I've got the following content : > {noformat} > b'{"error":{"code":null,"message":"The Prefer header \'return=minimal\' is > not supported for this HTTP Method."}}'{noformat} > > > > > {color:#808080} {color} -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Updated] (OLINGO-1332) Header Perfer: "return=minimal" or "return=representation" return Error "Prefer Header not supported"
[ https://issues.apache.org/jira/browse/OLINGO-1332?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Michael Bolz updated OLINGO-1332: - Fix Version/s: (Java) V4 4.6.0 > Header Perfer: "return=minimal" or "return=representation" return Error > "Prefer Header not supported" > - > > Key: OLINGO-1332 > URL: https://issues.apache.org/jira/browse/OLINGO-1332 > Project: Olingo > Issue Type: Bug > Components: odata4-server >Affects Versions: (Java) V4 4.5.0 >Reporter: Jerome BAROTIN >Assignee: Michael Bolz >Priority: Major > Fix For: (Java) V4 4.6.0 > > Attachments: OLINGO-1332.patch > > > > Hi, > {color:#33}Considering the following python script :{color} > {code:java} > # -*- encoding: utf-8 -*- > import requests > headers = { > 'Content-Type': 'application/json', > 'Prefer': 'return=minimal' > } > url = "http://localhost:8080/Customers(2)" > r = requests.get(url, headers=headers)) > print(r.content){code} > If I run it on my olingo implementation, I've got the following content : > {noformat} > b'{"error":{"code":null,"message":"The Prefer header \'return=minimal\' is > not supported for this HTTP Method."}}'{noformat} > > > > > {color:#808080} {color} -- This message was sent by Atlassian JIRA (v7.6.3#76005)