[ardoHTTP] Range header

Forge Component
(17)
Published on 20 Jan (4 weeks ago) by Ricardo Silva
17 votes
Published on 20 Jan (4 weeks ago) by Ricardo Silva

Hi


I get following error when I put new header on ArdoHttp request: 

The 'Rage' header must be modified using the appropriate property or method. Parameter name: name


Regards,

Anahit

Hello Anahit,

Shouldn't be too hard to make the changes required to detect this scenario and use the appropriate functions but before I go ahead and do that I would like to ask you exactly what you're trying to do.


This is because you seem to be wanting to get a range of the resulting http request. ardoHTTP will try to parse that into a text and you may run into encoding issues if you happen to catch a multi-byte character and break it.

Hi Riacardo


thank you for quick answer.


I'm trying to change header Range when I send request. 


My request should look like this:


GET /api/actionableitems?itemtypes=301& itemtypes=2& itemtypes=1 HTTP/1.1
Host: ...
Authorization: ...
Range: items=0-12
cache-control: no-cache


I'm not able to send request because if gives me error when I set Range header.


Regards,

Anahit



Ricardo Silva wrote:

Hello Anahit,

Shouldn't be too hard to make the changes required to detect this scenario and use the appropriate functions but before I go ahead and do that I would like to ask you exactly what you're trying to do.


This is because you seem to be wanting to get a range of the resulting http request. ardoHTTP will try to parse that into a text and you may run into encoding issues if you happen to catch a multi-byte character and break it.



Ricardo Silva wrote:Hi Ricardo


Any hope for any solution ?


Regards,

Anahit

Hello Anahit,

Shouldn't be too hard to make the changes required to detect this scenario and use the appropriate functions but before I go ahead and do that I would like to ask you exactly what you're trying to do.


This is because you seem to be wanting to get a range of the resulting http request. ardoHTTP will try to parse that into a text and you may run into encoding issues if you happen to catch a multi-byte character and break it.




Hello 

I have made the below changes to the ardoHTTP extension locally. If you can follow the same steps and your server implements the Range request properly, then this should work. 

The below are the steps I followed

1) Open the extension code in VS

2) Add a reference to System.Net.Http 

3) See the code changes to  the method ProcessRequest Method. (Handling of range request)

4) Publish this extension to your environment & update your reference. 

This should solve your problem. 


Ricardo Silva  : I have sent you a request to join the team (pending). If you find the above fix suitable, could you please update the component and make a new release. 


Hello Anahit and Amal,

I'm currently on vacation and thus unable to look into this right away. I'll try to look further into it when I get back (early next week).


Amal: your solution seems acceptable and I will likely include it. Thank you.

Anahit: if you cannot wait for my return to upload a new version of ardoHTTP you could make the changes Amal mentions or get in touch with him.


Alternatively, since you seem to be attempting to consume a REST API, have you considered using the platform's builtin capabilities for that?

Amal Raj wrote:

Hello 

I have made the below changes to the ardoHTTP extension locally. If you can follow the same steps and your server implements the Range request properly, then this should work. 

The below are the steps I followed

1) Open the extension code in VS

2) Add a reference to System.Net.Http 

3) See the code changes to  the method ProcessRequest Method. (Handling of range request)

4) Publish this extension to your environment & update your reference. 

This should solve your problem. 


Ricardo Silva  : I have sent you a request to join the team (pending). If you find the above fix suitable, could you please update the component and make a new release. 


I guess i will use integration studio. Can you tell me input and output parameters and theirs types in integration studio?


gurgen10 wrote:

Amal Raj wrote:

Hello 

I have made the below changes to the ardoHTTP extension locally. If you can follow the same steps and your server implements the Range request properly, then this should work. 

The below are the steps I followed

1) Open the extension code in VS

2) Add a reference to System.Net.Http 

3) See the code changes to  the method ProcessRequest Method. (Handling of range request)

4) Publish this extension to your environment & update your reference. 

This should solve your problem. 


Ricardo Silva  : I have sent you a request to join the team (pending). If you find the above fix suitable, could you please update the component and make a new release. 


I guess i will use integration studio. Can you tell me input and output parameters and theirs types in integration studio?


Hi 

You dont need to change any parameters in the Integration studio. 

Only open the solution file and patch the ProcessRequest method with the Range Header code. 



Hello Anahit and Amaj,

Version 1.2.2 of ardoHTTP includes Amaj's code and should now support range headers.

Please give it a try, if you are still stuck on this.