How can we help you today?

How to Add HTTP Header to ShortPoint REST API or Web Service (XML) Connection Type

To work with some endpoint, sometimes we need to pass additional information to requests such as authorization information, cache control information, API version, etc. 


The web service usually takes this information from HTTP request headers. In this tutorial, we will show you how to add the HTTP header to ShortPoint REST API or Web Service (XML) connection types.


Prerequisites

  • You have ShortPoint installed on your SharePoint site(s).
  • You are a ShortPoint user with an active license.
  • You use ShortPoint version 6.6.x.x or later.

Solution


ShortPoint REST API and Web Service (XML) connection types have Custom headers function under Enable Advanced Settings section which allows you to set up all required headers:



Let's assume that you want to force caches to submit the request to the origin server for validation before releasing a cached copy. So you need to add Cache-Control header with value no-cache to HTTP request.



To do this, you need to set up headers object in Custom header function in the following format:

 

headers["<Header name>"] = <Header value>


For our case we get the following:

headers["Cache-Control"] = "no-cache";

return headers;



Note: Headers object can accept as many headers as you want and all of them will be added to the HTTP request.


After you are done, click Connect and finish up the connection setup.


That's it. Happy connecting!



Related articles:

Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.

World's best intranet sites are designed using ShortPoint

Get started today! Learn more
See all 30 topics

Start a trial

Ignite your vision. Install ShortPoint directly on your site, or play in sandbox mode. No credit card required.

Get started today

World’s best intranet sites are designed using ShortPoint

Thousands of companies using ShortPoint everyday to design, brand and build award winning intranet sites.

Get started Learn more