HTTP Get Content Type

I have a program that needs to interact with a web server and retrieve a file containing structured data using http and cgi. I have a couple of questions:

  • Cgi script on the server need to specify the body on the right? What should be the type of content?
  • Should I use POST or GET?
  • Can someone tell me a good resource for reading HTTP?
+3
source share
3 answers
  • The type of content specified by the server will depend on what data types you plan to return. As Jim said, if it's JSON, you can use "application / json". The obvious payload for the request will be any data that you send to the client.

  • , , . , , GET, POST. , , , URL- ( , POST).

  • rfc HTTP... , . , , .

+1

, Id GET. GET Content-Type, GET . HTTP, Id HTTP 1.1.

+3

(1) Content-Type . XML, application/xml, JSON application/json .. Content-Type . , Accept. ( .)

(2) GET ( - ).

RESTful Web Services HTTP. HTTP , .

0

Source: https://habr.com/ru/post/1720608/


All Articles