Edgio

Using UTF-8 Characters in Request Headers

For certain requests (see Requests that Support UTF-8) you can use UTF-8 character encoding in headers that specify paths and file names. When you use UTF-8 character encoding, you must include the X-Agile-Encoding header in your requests, like so:
1X-Agile-Encoding: UTF8
The header is optional and encoding defaults to US ASCII.
If you supply an invalid encoding, Origin Storage returns a 400 HTTP Status Code with reason -51, invalid coding.
Notes:
  • All path name and file name headers also support US ASCII.
  • Although the JSON-RPC interface supports UTF-8, the interface uses unicode escaping rather than URL encoding. For example, файлы is \\u0444\\u0430\\u0439\\u043b\\u044b.

Requests that Support UTF-8

The following requests support UTF-8 and the X-Agile-Encoding header:
RequestHeaders in the Request that Support UTF-8
Create multipart (multipart/create)X-Agile-Directory, X-Agile-Basename
Post Raw (post/raw)

See File Raw Post.
X-Agile-Directory, X-Agile-Basename request parameters

X-Agile-Path response parameter
Notes:
  • Create multipart piece (multipart/piece) and complete multipart (multipart/complete) do not require UTF-8 encoding because they do not allow the caller to pass file names.
  • Origin Storage path segment names and file names have a limit of 4096 bytes. Because UTF-8 is supported, be sure to calculate the actual length before passing paths and file names in headers if you are using other than basic Latin letters, digits, and punctuation signs. See Path Segment and File Name Limitations for additional information.

Request and Response Example

Here is a sample request using UTF-8 encoding:
1POST /post/raw HTTP/1.1
2User-Agent: curl/7.22.0 (x86_64-pc-linux-gnu) libcurl/7.22.0 OpenSSL/1.0.1 zlib/1.2.3.4 libidn/1.23 librtmp/2.3
3Host: example.net:8080
4Accept: */*
5X-Agile-Authorization: d9e89ef8-fe07-4b6a-8cc5-bc03e4d1ce42
6X-Agile-Directory: /
7X-Agile-Basename: test%20file.txt
8X-Agile-Encoding: UTF8
9Content-Length: 29
10Content-Type: application/x-www-form-urlencoded
11[29 bytes of data]
Here is a sample response:
1HTTP/1.1 200 OK
2Date: Tue, 03 Feb 2015 22:40:42 GMT
3Server: Apache/2.2.22 (Ubuntu)
4X-Agile-Status: 0
5Content-Length: 0
6X-Agile-Checksum: 6908750bc780002d195e362de56a77ad79bbc36091159032763b4387cdb0fca5
7X-Agile-Size: 29
8X-Agile-Path: /test%20file.txt
9Vary: Accept-Encoding
10Content-Type: text/xml;charset=utf-8