Announcements
Known issues updated. Learn more

C# Dropbox.api nuget - Upload via proxy

New member | Level 2

Hi,

I am using Dropbox.api nuget in C#.

I would like to know if there is an option to set a proxy that the files will be uploud using it?..

1 Accepted solution

Accepted Solutions

Re: C# Dropbox.api nuget - Upload via proxy

Dropboxer

I don't believe we have any specific sample code for this, but you can construct a DropboxClient with a custom HttpClient which can include proxy settings:

https://dropbox.github.io/dropbox-sdk-dotnet/html/M_Dropbox_Api_DropboxClient__ctor_1.htm

https://dropbox.github.io/dropbox-sdk-dotnet/html/T_Dropbox_Api_DropboxClientConfig.htm

Reply
Loading...
3 Replies

Re: C# Dropbox.api nuget - Upload via proxy

Dropboxer

I don't believe we have any specific sample code for this, but you can construct a DropboxClient with a custom HttpClient which can include proxy settings:

https://dropbox.github.io/dropbox-sdk-dotnet/html/M_Dropbox_Api_DropboxClient__ctor_1.htm

https://dropbox.github.io/dropbox-sdk-dotnet/html/T_Dropbox_Api_DropboxClientConfig.htm

Reply
Loading...

Re: C# Dropbox.api nuget - Upload via proxy

New member | Level 2

Thanks!

Reply
Loading...

Re: C# Dropbox.api nuget - Upload via proxy

Explorer | Level 4

I have begun to work with Dropbox api and I encountered this issue.

Here is my solution.

private static DbxClientV2 getClient(String token, String host) {
		Proxy proxy = getProxy();
		Config config = Config.builder().withProxy(proxy).build();		
		StandardHttpRequestor requester = new StandardHttpRequestor(config);
		DbxRequestConfig requestConfig = DbxRequestConfig.newBuilder("example").withHttpRequestor(requester).build();
		DbxClientV2 dbxClient = new DbxClientV2(requestConfig, token, host);
		return dbxClient;
	} 

 

Reply
Loading...
API Support

Have a question? Our Dropbox Community is here to help you find an answer!
You won’t have to wait too long for a reply, but why not learn more about the Community while you’re here.

Not the right discussion for you? Find out what else our Community has to say about API Support.

Or, search our Help Center for even more.

Who's talking
Top contributors to this post