You are on page 1of 2

‫‪Copy Method In HTTP/1.

1‬‬

‫از ایي هتذ برای ایجاد یک رًٍَشت از هٌبع (فایل) ای کِ تَسط )‪ Uniform Resource Identifier (URI‬هشخص هی شَد استفادُ‬
‫هی شَد‪.‬‬

‫ایي رًٍَشت هی تَاًذ در دایرکتَری دیگری کِ تحت ّواى داهٌِ باشذ رخیرُ گردد‪.‬‬

‫هثال ‪:‬‬

‫در هثال زیر سعی دارین رًٍَشتی از فایل ”‪ “index.html‬هَجَد در پَشِ ( دایرکتَری ) ”‪ “username‬را در دایرکتَری "‪" folder‬‬

‫ایجاد کنیم ‪ .‬پاراهتر ”‪ً “Host‬وایاًگر داهٌِ هَرد ًظر ٍ پاراهتر ”‪ً “Destination‬شاى دٌّذُ هقصذ رًٍَشت هی باشذ‪.‬‬

‫‪Request‬‬

‫‪Copy‬‬
‫‪COPY /~nima/index.html HTTP/1.1‬‬
‫‪Host: www.afraz.mp‬‬
‫‪Destination: http://www.afraz.mp/~nima/folder/index.html‬‬
‫‪Overwrite: T‬‬

‫‪Response‬‬

‫دریافت پاسخ زیر ًشاًگر اًجام عولیات بصَرت هَفقیت آهیس هی باشذ‪.‬‬

‫‪Copy‬‬
‫‪HTTP/1.1 201 Created‬‬

‫در صَرتی کِ دریافت پاسخ زیر عذم هجَز دسترسی بِ دایرکتَری هقصذ را هشخص هی کٌذ‪.‬‬

‫‪Copy‬‬
‫‪HTTP/1.1 423 Locked‬‬

‫‪860080868‬‬ ‫ًیوا افراز کارشٌاسی سخت افسار داًشگاُ آزاد اردبیل‬


Copy Method In HTTP/1.1

.‫جذٍل زیر کذّای ٍضعیتی کِ هوکي است در پاسخ ّا با آى هَاجِ شَیذ را ًشاى هی دّذ‬

Status Codes

Status Code Meaning

201 (Created) The resource was successfully copied.


204 (No Content) The source resource was successfully copied to a pre-existing
destination resource.
403 (Forbidden) The source URI and the destination URI are the same.
409 (Conflict) A resource cannot be created at the destination URI until one or more
intermediate collections are created.
412 (Precondition Either the Overwrite header is "F" and the state of the destination resource is not
Failed) null, or the method was used in a Depth: 0 transaction.
423 (Locked) The destination resource is locked.
502 (Bad Gateway) The COPY destination is located on a different server, which refuses to accept
the resource.
507 (Insufficient The destination resource does not have sufficient storage space.
Storage)

References :

860080868 ‫ًیوا افراز کارشٌاسی سخت افسار داًشگاُ آزاد اردبیل‬

You might also like