OBP-API
OBP-API copied to clipboard
searchWarehouse gives URL not found if content-type: application/json missing
if we do not send the content-type in the header, we get:
The Requested URL /obp/v3.0.0/search/warehoudse/ALL was not found on this server
Which client you used? @tawoe
It's up to client to define all necessary parts of a POST call.
For instance in case of User-Agent Dispatch/0.14.0-SNAPSHOT
default value for Content-Type is text/plain; charset=UTF-8
:
POST /obp/v3.0.0/search/warehouse/ALL HTTP/1.1
Authorization: OAuth oauth_consumer_key="b0xryqbo2h5kxr1ahq2u113kgyb1wfn5kxy5phak",oauth_nonce="17319143334805",oauth_signature="yaHyiCP0MQlX4CYZ%2FgFHxcbGr1E%3D",oauth_signature_method="HMAC-SHA1",oauth_timestamp="1545651871",oauth_token="mij5ekx3beemj55ujywxmn1zxx5m0gon3vap4gz5",oauth_version="1.0"
Accept: application/json
Content-Type: text/plain; charset=UTF-8
Content-Length: 116
Host: localhost:8016
User-Agent: Dispatch/0.14.0-SNAPSHOT
But at the endpoint we expect Content-Type: application/json
i.e.
case "search" :: "warehouse" :: "statistics" :: index :: field :: Nil JsonPost json -> _ => {
means:
/**
* Test to see if the request is a POST, has JSON data in the
* body and expecting JSON in the response.
* The path, JSON Data and the Req instance are extracted.
*/