sp-dev-docs icon indicating copy to clipboard operation
sp-dev-docs copied to clipboard

sp-http does not support Batches - index-internal"' has no exported member 'ISPHttpClientBatchCreationOptions'.

Open nikolayyordanov opened this issue 8 years ago • 6 comments

Category

  • [x] Question
  • [ ] Typo
  • [ ] Bug
  • [ ] Additional article idea

Want to use the Clientbatch functionality of Sp-http but in the latest version it is not exported in the index-internal

nikolayyordanov avatar Aug 20 '18 12:08 nikolayyordanov

Looks like you are not using the --plus-beta flag.

When generating your SPFx solution via the Yeoman generator, you need to add the plus-beta flag since SPHttpClientBatch is currently in preview. Since SPFx 1.5, the preview packages have been removed from the default installation. To use these packages, you need to explicitly request them using this flag.

So, create a new solution and in the generator add the flag as:

yo @microsoft/sharepoint --plusbeta

After that, you can import them in your webpart as:

import { SPHttpClient, ISPHttpClientBatchOptions, ISPHttpClientBatchCreationOptions, ISPHttpClientBatchConfigurations, SPHttpClientResponse, SPHttpClientBatch } from '@microsoft/sp-http';

gautamdsheth avatar Aug 20 '18 14:08 gautamdsheth

Clientbatch functionality will move away from beta status to production status with the 1.6 version coming soon. Until then @gautamdsheth's comment is 100% valid. Closing as answered.

VesaJuvonen avatar Aug 21 '18 13:08 VesaJuvonen

@VesaJuvonen looks like this is excluded from 1.6 release right? Thanks!

kchiragowni avatar Sep 12 '18 16:09 kchiragowni

Yes, it is only in plusbeta.

nikolayyordanov avatar Sep 12 '18 18:09 nikolayyordanov

Hi All, Any update on the the ISPHttpClientBatchCreationOptions, SPHttpClientBatch release?

schinna avatar Feb 26 '19 22:02 schinna

Issues that have been closed & had no follow-up activity for at least 7 days are automatically locked. Please refer to our wiki for more details, including how to remediate this action if you feel this was done prematurely or in error: Issue List: Our approach to locked issues

msft-github-bot avatar Jan 27 '20 00:01 msft-github-bot