Snippets tagged “content-type”
10 snippets use this tag.
- curl POST format for CURLOPT_POSTFIELDSPHP
To make a POST request with PHP's cURL functions, you can use the CURLOPT_POST option to send POST data.
- curl posting with header application/x-www-form-urlencodedPHP
To make a POST request using curl and include a header of Content-Type: application/x-www-form-urlencoded, you can use the following command:
- How to get a file's Media Type (MIME type)?Java
To get the media type (also known as MIME type) of a file in Java, you can use the Files.probeContentType method of the java.nio.file.Files class.
- How to POST JSON data with Python Requests?Python
You can use the requests library in Python to send a POST request with JSON data.
- How to Return JSON from a PHP ScriptPHP
This short tutorial will represent to you the most effective way of returning JSON from a PHP script.
- Http 415 Unsupported Media type error with JSONJava
A HTTP 415 Unsupported Media Type error means that the server is unable to process the request because the request entity has a media type that the server does not support. In the context of a JSON request, this means that the server is unable to process
- Issue reading HTTP request body from a JSON POST in PHPPHP
In PHP, you can read the body of an HTTP request using the file_get_contents('php://input') function.
- Java - sending HTTP parameters via POST method easilyJava
To send HTTP parameters via the POST method in Java, you can use the java.net.URL and java.net.HttpURLConnection classes. Here is an example of how you can do this:
- PHP returning JSON to JQUERY AJAX CALLPHP
To return JSON from a PHP script to a jQuery AJAX call, you can use the json_encode() function in PHP to convert an array or object into a JSON string.
- Sending HTTP POST Request In JavaJava
To send an HTTP POST request in Java, you can use the java.net.URL and java.net.HttpURLConnection classes. Here is an example of how you can use these classes to send a POST request: