jquery-binarytransport

WebJar for jquery-binarytransport

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

jquery-binarytransport
Last Version

Last Version

1.0.0
Release Date

Release Date

Type

Type

jar
Description

Description

jquery-binarytransport
WebJar for jquery-binarytransport
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/nseba/jquery-binarytransport

Download jquery-binarytransport

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/jquery-binarytransport/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>jquery-binarytransport</artifactId>
    <version>1.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/jquery-binarytransport/
implementation 'org.webjars.npm:jquery-binarytransport:1.0.0'
// https://jarcasting.com/artifacts/org.webjars.npm/jquery-binarytransport/
implementation ("org.webjars.npm:jquery-binarytransport:1.0.0")
'org.webjars.npm:jquery-binarytransport:jar:1.0.0'
<dependency org="org.webjars.npm" name="jquery-binarytransport" rev="1.0.0">
  <artifact name="jquery-binarytransport" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='jquery-binarytransport', version='1.0.0')
)
libraryDependencies += "org.webjars.npm" % "jquery-binarytransport" % "1.0.0"
[org.webjars.npm/jquery-binarytransport "1.0.0"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

jQuery BinaryTransport

jQuery ajax transport for making binary data type requests.

How to use?

While creating request, setup dataType as "binary"

$.ajax({
		  url: "image.png",
		  type: "GET",
		  dataType: 'binary',
		  processData: false,
		  success: function(result){
		  }
});				

Default response type is blob. If you want receive ArrayBuffer as a response type, you can use responseType parameter while creating an Ajax request:

responseType:'arraybuffer',

How to setup custom headers?

It is possible to set multiple custom headers when you are making the request. To set custom headers, you can use "header" parameter and set its value as an object, which has list of headers:

$.ajax({
		  url: "image.png",
		  type: "GET",
		  dataType: 'binary',
		  headers:{'Content-Type':'image/png','X-Requested-With':'XMLHttpRequest'},
		  processData: false,
		  success: function(result){
		  }
});	

Another options

** Asynchronous or synchronous execution **

It is possible to change execution type from asynchronous to synchrous when setting parameter "async" to false.

async:false,

** Login with user name and password **

If your script needs to have authentication during the request, you can use username and password parameters.

username:'john', password:'smith',

Supported browsers

BinaryTransport requires XHR2 responseType, ArrayBuffer and Blob response type support from your browser, otherwise it does not work as expected. Currently most major browsers should work fine.

Firefox: 13.0+ Chrome: 20+ Internet Explorer: 10.0+ Safari: 6.0 Opera: 12.10

Versions

Version
1.0.0