I have tried to upload a mp3 file using sound cloud console app
https://developers.soundcloud.com/console
parameters I am giving are
format: json
title : Title
asset_data: C:\Users\Admin\Music\songs\audio.mp3
using Post
I am getting error
HTTP/1.1 422 Unprocessable Entity
Here's an example that works:
C:\>"Share on SoundCloud.exe" /client_id:YOUR_CLIENT_ID /track[asset_data]:audio.mp3 /track[title]:"Test Sound" /oauth_token:YOUR_ACCESS_TOKEN
Be aware that in your case, instead of audio.mp3, you should put "C:/Users/Admin/Music/songs/audio.mp3".
Related
I am currently learning RESTFUL web service tutorial using postman software. However, I am not able to see the error message detail that was shown in my tutorial. May I know how can I get the "message" to be display in postman response body? Thank you.
Below show the example from my tutorial.
Whatever backend framework you are using look for the Environment Debug variable and set it to true if you are using laravel go to env file and set APP_DEBUG=true
I am trying to create a TileSet source using the MTS (Mapbox Tiling Service) api. I am uploading a geojson of size 66MB. And it comes back with the error
https://api.mapbox.com/tilesets/v1/sources/username/TilesetSourceName?access_token=token
{
"message": "request entity too large"
}
Api documentation says each individual source file must not exceed 20 GB.
Does anyone know why I'm getting this error?
Content-Type was incorrectly set. I was using Postman, latest update seems to have broken it.
It was working fine before. Tried with curl and it worked
Am following the "Streaming HTTP Response" documentation of Play2! framework which describes how a file or stream could be sent as chunked responses. The http-action code I wrote after reading this is very simple -
Ok.chunked(
Enumerator.fromStream(istream).andThen(Enumerator.eof)
)
With this code everytime I refresh the URL the data in the stream gets downloaded as a file by the browser. Instead of downloading as a file I want the stream content to shown inline in the browser as text. The File example on the documentation page describes how one could do this with files... but looking at the APIs I dont see an inline option with streams. So is it possible to show stream data inline with chunked responses everytime I refresh the browser? If my expectation is invalid then a little explanation of why-so will be very welcome.
From my comment: You should set a content-type supported by your browser (like text/plain or text/xml) when sending the response, otherwise you're just sending bytes and the browser doesn't "know" it can display it.
Update: adding the exact code that solved the issue:
Ok.chunked( Enumerator.fromStream(istream).andThen(Enumerator.eof) ).as("text/html")
When I post a image from a iphone application, my rails application raises the exception:
Paperclip exception : Paperclip::AdapterRegistry::NoHandlerError].
My iPhone application posts the image by multipart.
When I upload a image from my web site the rails application does not raise this exception.
Where can I look to see why it does not work? Thank you.
I already have had this error on a nested form and it was because I forgot the set the multipart to true.
Use a tool to log requests sent by your iPhone and then you can see were the request is malformed.
Charles Proxy is perfect for that.
Related topic : How can I debug network requests from my iPhone?
I am posting (HTTP POST) various values to the posterous api. I am successfully able to upload the title, body, and ONE media file, but when I try to add in a second media file I get a server 500.
They do allow media and media[] as parameters.
How do I upload multiple files with the iPhone SDK?
The 500 your getting is probably based on one of two things:
An incorrect request
An error on the server
Now, if its an incorrect, the HTTP server would be more helpful responding back with like a 415 (unsupported media type) or something. A 500 insists that something went wrong on the server and that your request was valid.
You'll have to dig into the server API or code (if you wrote it), or read the docs and figure out what's wrong with your second request ... seems like maybe your not setting the appropriate media type?
EDIT: Ok, so I looked at the API. It appears your posting XML, so your request content-type should be
Content-Type: application/xml
The API doc didn't specifically say, but that would be the correct type.
EDIT: Actually on second glance, are you just POSTing w/URI params? Their API doc isn't clear (I'm also looking rather quickly)