cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Announcements

1077
Views
0
Helpful
2
Replies
Sukhadeo Prasad
Beginner

Finesse REST API

Hi,

 

I am accessing PhoneBooks using Finesse REST API 

https://finesse11.ucce11.com:8445/finesse/api/User/7016/PhoneBooks/

 

The JAVA code works well 

connection.setRequestProperty("Authorization", _AuthHeader);
connection.setRequestProperty("Content-Type", "Application/XML;charset=utf-8");
connection.setRequestProperty("Range", "objects=1-1500");

 

But below C# implementation always gives "The remote server returned an error: (400) Bad Request." error. This is only when accessing PhoneBooks.

wc = new WebClient();
wc.Headers.Add(HttpRequestHeader.Authorization, _AuthHeader);
wc.Headers.Add(HttpRequestHeader.ContentType, "application/xml;charset=utf-8");
wc.Headers.Add(HttpRequestHeader.ContentRange, "objects=1-1500");

 

Is there anything wrong while setting the Range header?

 

Thanks,

Sukhadeo.

 

 

2 REPLIES 2
Sukhadeo Prasad
Beginner

HttpWebRequest request = (HttpWebRequest)WebRequest.Create(uri);

request.AddRange("objects", 1, 1500);

 

Works.

 

Thanks.

Sukhadeo Prasad
Beginner

HttpWebRequest request = (HttpWebRequest)WebRequest.Create(uri);
request.AddRange("objects", 1, 1500);

 

This worked.

Create
Recognize Your Peers
Content for Community-Ad