PCPP 32 10x PCPP Certified Professional Python Programmer 1 · Free Practice Question Easy

Question 31

You are developing a Python application that interacts with a RESTful API. As part of the application's functionality, you need to analyze the server's response headers. Which of the following HTTP headers is commonly used to specify the format of the data being returned in the response?

  • A

    Content-Disposition

  • B

    Content-Type

  • C

    Content-Length

  • D

    Content-Encoding

  • E

    Content-Range

Reveal correct answer

Correct answer: B

A.

This header is used to suggest a filename to the user-agent when the response content is being downloaded. It does not indicate the content type. Therefore, this answer is incorrect.

B.

This header is commonly used to indicate the media type or content type of the response. It specifies the format of the data being returned, such as "application/json" or "text/html". This header is directly relevant to determining the content type of the response. Therefore, this is the correct answer.

C.

This header specifies the size of the response content in bytes. It does not provide information about the content type. Hence, this answer is incorrect.

D.

This header is used to specify the encoding applied to the response content, such as gzip or deflate. It does not convey information about the content type. Thus, this answer is incorrect.

E.

This header is used to indicate the range of bytes being returned in a partial response. It does not provide information about the content type. Thus, this answer is incorrect.

Discussion

Think the marked answer is wrong, or have a better explanation? Share it below — comments appear after review.

You must be logged in to post a comment.

Preparing For

Your Certification?

255+ certifications
Detailed explanations
Free PDF samples

Has All The Questions You Need