Sending Post Request.
See original GitHub issueHello, I would like to send a simple post request in order to create a new project with a given project name. First try:
URL = 'http://localhost:8080/api/v2/projects'
dataa={
"messages": [],
"body": {
"name": "Dummy_Name2"
}
}
r = requests.post(URL, data = dataa,auth=('admin', 'admin'))
Output:
{'timestamp': 1528204046959, 'status': 415, 'error': 'Unsupported Media Type', 'exception': 'org.springframework.web.HttpMediaTypeNotSupportedException', 'message': "Content type 'application/x-www-form-urlencoded' not supported", 'path': '/api/v2/projects'}
Any opinion is appreciated.
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (6 by maintainers)
Top Results From Across the Web
How do I send an POST request? - ReqBin
The HTTP POST request method is used to send data to the server or create or update a resource. The POST request is...
Read more >How to manually send HTTP POST requests from Firefox or ...
The simplicity of pressing F12 , write the command in the console tab (or press the up key if you used it before)...
Read more >POST - HTTP - MDN Web Docs
The HTTP POST method sends data to the server. The type of the body of the request is indicated by the Content-Type header....
Read more >Python Requests post Method - W3Schools
The post() method sends a POST request to the specified url. The post() method is used when you want to send some data...
Read more >HTTP | Part 4: HTTP POST Request - YouTube
HTTP - Module 4/5 In this video, you will see an example of how you can use the HTTP app inside Integromat in...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The
Content-Type
header needs to specify a multipart boundary, e.g.curl -u username:password -X POST --header 'Content-Type: multipart/form-data; boundary=---multipart-boundary-RANDOMSTRING' --header 'Accept: application/json' 'http://localhost:8080/webanno-webapp/api/v2/projects?name=test'
then you get sensible output:
Working Python solution: