Batch request to odata v4 from angularjs getting error - odata

I am trying to call a batch request from angularjs using a service(angular-http-batch.js) to an ODataV4 Web Api endpoint.But i am getting the error
"The 'Content-Type' header value 'application/http; msgtype=request' is invalid. When this is the start of the change set, the value must be 'multipart/mixed'; otherwise it must be 'application/http'."
Is i missed out any configuration in odata ?.

Related

How to pass multiple host header from postman

I am trying to add multiple host header for post http request on postman , but I am getting error like Error: hostHeader.startsWith is not a function .
If I pass single header it is working , but if I pass one more header it is throwing the error could not send the request with the above message.
Is there any configuration I need to have to allow multiple host headers

AWS API Gateway issue for HTTP Method

I created an AWS API-gateway for an HTTP method PUT. When I do a test in API-gateway, that works fine, but when I call it from a REST client, I get 404 bad-request and missing authentication token errors. I didn't set any authorization to true or a required API key to true.
I passed these query parameters to a REST client:
auth_id : 8798iuyiu123123
time_stamp :1231231
test_json : [{"id"=>"1","value"=>"mount"},{"id"=>"2","value"=>"chart"}]
HEADER
content-type : application/json
When I change the test_json value to %5B%7B%22id%22:%221%22,%22value%22:%22test%22%7D,%7B%22id%22:%222%22,%22value%22:%2213+%D8%B4%D8%A7%D8%B1%D8%, then I get the response.
i am new to react, calling from react
Request.put('https://api-gateway.sqwdwed123.com/eretw/update-chart')
.set('Content-Type', 'application/json')
.query({ auth_id: localStorage.auth_id})
.query({ time_stamp:this.props.time_stamp})
.query({ test_json:JSON.stringify(newadd)})
should i pass this test_json through body?
Am I doing anything wrong?
This is usually related to requesting a URL that doesn't exist. Please make sure you're using the correct HTTP method and resource path to a valid resource (the sample invoke URL does not include any resource path). If this still doesn't work. Make sure you actually deployed your API.
The HTTP Response of Bad Request is because you have the Query Parameter that are not URL Encoded. There are 2 things that you can do now:
Pass the test_json as Query Param but making sure that they are URL Encoded. This will put a restriction on the size of the string and hence Not Recommended.
Pass the test_json as Request Body. (Recommended)

Can read local JSON using rest assured

I am learning rest assured and trying to read my local javascript file. I am not sure if I can do that
This is what I am trying
Response resp = get("C:/dev/testrest.js");
assertEquals(200, resp.getStatusCode());
Here testrest.js is JSON
I am getting this error
java.lang.AssertionError: expected:<200> but was:<404>
REST Assured is for testing HTTP services (servers) and not for working with Javascript files. If you're looking for easily extracting values out of a JSON document you should have a look at JsonPath which is shipped with REST Assured (see getting started guide).

SOAPUI REST url having + in JSON issue

I am using SOAPUI v4.6.4.
I am testing REST SOAPUI test. I have the media type set to application/json.
I am trying to pass this value as part of JSON string and I get 404 server error.
{"enteredTime":"2001-12-17T09:30:47+05:00"}
It is having issues with + sign.
I tried encoding it as 2001-12-17T09%3A30%3A47%2B05%3A00. The 404 server is gone but the application code is NOT expecting the encoded value.
Any solutions are highly appreciated.

Issue with the rails (2.3.11) server(production side)

I am stuck with a very unusual issue. I am trying to call a webservice request from the server (actully an ajax 2 step request from the client side) for which i am getting an xml formatted response which i am parsing using a treeview. The issue is..its working well in development mode on local server but showing error in production with the same codes. When I initiate a request I get a response for the first step in string format but showing error "error loading xmlDoc: xmlDoc is undefined" for the second request which suppose to be initiated directly after the first response.
codes are available here:
https://github.com/domthu/microaquadt/blob/master/app/views/oligo_sequences/edit.html.erb
error is somewhere on the function starting from line 195.
Any help or suggestion would be much appreciated...!!!!

Resources